Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

Commit

Permalink
Version 1.4.27
Browse files Browse the repository at this point in the history
(Windows 10) Thanks to another workaround found, it has been added to
DS4Windows, there is a button on the main tab, to connect your
controller exclusively, this will temporarily kill explorer (The
taskbar) and bring it back once a controller is connected
Macros: When recording with a delay, you can now add rumble and changing
the lightbar color during the macro, you can use the touchpad zones to
add rumble or lightbar options. To change how much rumble happens or the
lightbar color, just double click the item in the list
  • Loading branch information
Jays2Kings committed Aug 13, 2015
1 parent 7143a0c commit 3680b6b
Show file tree
Hide file tree
Showing 14 changed files with 1,018 additions and 477 deletions.
41 changes: 37 additions & 4 deletions DS4Windows/DS4Control/Mapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ public static async void MapCustomAction(int device, DS4State cState, DS4State M
DateTime now = DateTime.UtcNow;
if (!subtriggeractivated && now <= oldnowKeyAct[device] + TimeSpan.FromMilliseconds(250))
{
await Task.Delay(3); //if the button is assigned to the same key use a delay so the keydown is the last action, not key up
await Task.Delay(3); //if the button is assigned to the same key use a delay so the key down is the last action, not key up
triggeractivated = true;
oldnowKeyAct[device] = DateTime.MinValue;
}
Expand Down Expand Up @@ -1459,6 +1459,10 @@ public static async void MapCustomAction(int device, DS4State cState, DS4State M
{
if (Global.getCustomButton(device, action.trigger[0]) != X360Controls.Unbound)
Global.getCustomButtons(device)[action.trigger[0]] = X360Controls.Unbound;
if (Global.getCustomMacro(device, action.trigger[0]) != "0")
Global.getCustomMacros(device).Remove(action.trigger[0]);
if (Global.getCustomKey(device, action.trigger[0]) != 0)
Global.getCustomMacros(device).Remove(action.trigger[0]);
string[] dets = action.details.Split(',');
DS4Device d = ctrl.DS4Controllers[device];
//Global.cus
Expand Down Expand Up @@ -1493,7 +1497,7 @@ public static async void MapCustomAction(int device, DS4State cState, DS4State M
}

int type = 0;
string macro = "91/71/71/91";
string macro = "";
if (tappedOnce) //single tap
{
if (int.TryParse(dets[0], out type))
Expand Down Expand Up @@ -1625,15 +1629,41 @@ private static async void PlayMacro(int device, bool[] macrocontrol, string macr
keys = new int[0];
}
for (int i = 0; i < keys.Length; i++)
keys[i] = ushort.Parse(skeys[i]);
keys[i] = int.Parse(skeys[i]);
bool[] keydown = new bool[286];
if (control == DS4Controls.None || !macrodone[DS4ControltoInt(control)])
{
if (control != DS4Controls.None)
macrodone[DS4ControltoInt(control)] = true;
foreach (int i in keys)
{
if (i >= 300) //ints over 300 used to delay
if (i >= 1000000000)
{
string lb = i.ToString().Substring(1);
if (i > 1000000000)
{
byte r = (byte)(int.Parse(lb[0].ToString()) * 100 + int.Parse(lb[1].ToString()) * 10 + int.Parse(lb[2].ToString()));
byte g = (byte)(int.Parse(lb[3].ToString()) * 100 + int.Parse(lb[4].ToString()) * 10 + int.Parse(lb[5].ToString()));
byte b = (byte)(int.Parse(lb[6].ToString()) * 100 + int.Parse(lb[7].ToString()) * 10 + int.Parse(lb[8].ToString()));
DS4LightBar.forcelight[device] = true;
DS4LightBar.forcedFlash[device] = 0;
DS4LightBar.forcedColor[device] = new DS4Color(r, g, b);
}
else
{
DS4LightBar.forcedFlash[device] = 0;
DS4LightBar.forcelight[device] = false;
}
}
else if (i >= 1000000)
{
DS4Device d = Program.rootHub.DS4Controllers[device];
string r = i.ToString().Substring(1);
byte heavy = (byte)(int.Parse(r[0].ToString()) * 100 + int.Parse(r[1].ToString()) * 10 + int.Parse(r[2].ToString()));
byte light = (byte)(int.Parse(r[3].ToString()) * 100 + int.Parse(r[4].ToString()) * 10 + int.Parse(r[5].ToString()));
d.setRumble(light, heavy);
}
else if (i >= 300) //ints over 300 used to delay
await Task.Delay(i - 300);
else if (!keydown[i])
{
Expand Down Expand Up @@ -1750,6 +1780,9 @@ private static async void PlayMacro(int device, bool[] macrocontrol, string macr
else
InputMethods.performKeyRelease(i);
}
DS4LightBar.forcedFlash[device] = 0;
DS4LightBar.forcelight[device] = false;
Program.rootHub.DS4Controllers[device].setRumble(0, 0);
if (keyType.HasFlag(DS4KeyType.HoldMacro))
{
await Task.Delay(50);
Expand Down
9 changes: 8 additions & 1 deletion DS4Windows/DS4Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.ro-RO.resx" />
<EmbeddedResource Include="Properties\Resources.ru-RU.resx" />
Expand All @@ -470,7 +471,11 @@
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Resources1.Designer.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
Expand Down Expand Up @@ -513,6 +518,7 @@
<Content Include="Resources\imageres_import.png" />
<Content Include="Resources\imageres_new.png" />
<Content Include="Resources\LB.png" />
<None Include="Resources\left touch.png" />
<Content Include="Resources\LEFT.png" />
<Content Include="Resources\LeftTouch.png" />
<Content Include="Resources\LS.png" />
Expand All @@ -529,6 +535,7 @@
<Content Include="Resources\rainbowC.png" />
<Content Include="Resources\RB.png" />
<Content Include="Resources\Red Circle.png" />
<None Include="Resources\right touch.png" />
<Content Include="Resources\RIGHT.png" />
<Content Include="Resources\RightTouch.png" />
<Content Include="Resources\RS.png" />
Expand Down
82 changes: 46 additions & 36 deletions DS4Windows/DS4Windows/DS4Form.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3680b6b

Please sign in to comment.