Skip to content

Commit

Permalink
Version 1.4.26
Browse files Browse the repository at this point in the history
Updated German translation
Added Turkish translation (Thanks Lütfi)
When the battery is low and the controller is disconnected, The
notification tell you to charge the controller, this notification also
now shows the controller number instead of the mac address
While Double tapping to drag or left clicking the touchpad, you can use
a second finger to drag the mouse cursor (ala Mac touchpads)
In Auto Profiles, you can now add a directory/folder of programs
  • Loading branch information
Jays2Kings committed Jun 1, 2015
1 parent f70b606 commit 5945185
Show file tree
Hide file tree
Showing 41 changed files with 21,194 additions and 8,451 deletions.
44 changes: 23 additions & 21 deletions DS4Control/ControlSerivce.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,12 @@ protected virtual void On_DS4Removal(object sender, EventArgs e)
{
CurrentState[ind].Battery = PreviousState[ind].Battery = 0; // Reset for the next connection's initial status change.
x360Bus.Unplug(ind);
LogDebug(Properties.Resources.ControllerWasRemoved.Replace("*Mac address*", device.MacAddress));
Log.LogToTray(Properties.Resources.ControllerWasRemoved.Replace("*Mac address*", device.MacAddress));
string removed = Properties.Resources.ControllerWasRemoved.Replace("*Mac address*", (ind +1).ToString());
if (DS4Controllers[ind].Battery <= 20 &&
DS4Controllers[ind].ConnectionType == ConnectionType.BT && !DS4Controllers[ind].Charging)
removed += ". " + Properties.Resources.ChargeController;
LogDebug(removed);
Log.LogToTray(removed);
System.Threading.Thread.Sleep(XINPUT_UNPLUG_SETTLE_TIME);
DS4Controllers[ind] = null;
touchPad[ind] = null;
Expand Down Expand Up @@ -778,29 +782,27 @@ public virtual void StartTPOff(int deviceID)
Global.ScrollSensitivity[deviceID] = 0;
}
}

public virtual string TouchpadSlide(int ind)
{
DS4State cState = CurrentState[ind];
string slidedir = "none";
if (DS4Controllers[ind] != null)
if (cState.Touch2)
if (DS4Controllers[ind] != null)
if (touchPad[ind].slideright && !touchslid[ind])
{
slidedir = "right";
touchslid[ind] = true;
}
else if (touchPad[ind].slideleft && !touchslid[ind])
{
slidedir = "left";
touchslid[ind] = true;
}
else if (!touchPad[ind].slideleft && !touchPad[ind].slideright)
{
slidedir = "";
touchslid[ind] = false;
}
if (DS4Controllers[ind] != null && cState.Touch2 && !(touchPad[ind].dragging || touchPad[ind].dragging2))
if (touchPad[ind].slideright && !touchslid[ind])
{
slidedir = "right";
touchslid[ind] = true;
}
else if (touchPad[ind].slideleft && !touchslid[ind])
{
slidedir = "left";
touchslid[ind] = true;
}
else if (!touchPad[ind].slideleft && !touchPad[ind].slideright)
{
slidedir = "";
touchslid[ind] = false;
}
return slidedir;
}
public virtual void LogDebug(String Data, bool warning = false)
Expand Down
20 changes: 13 additions & 7 deletions DS4Control/Mouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ public Mouse(int deviceID, DS4Device d)
wheel = new MouseWheel(deviceNum);
}

public override string ToString()
{
return "Standard Mode";
}

public virtual void touchesMoved(object sender, TouchpadEventArgs arg)
{
if (!Global.UseTPforControls[deviceNum])
{
cursor.touchesMoved(arg);
wheel.touchesMoved(arg);
cursor.touchesMoved(arg, dragging || dragging2);
wheel.touchesMoved(arg, dragging || dragging2);
}
else
{
Expand Down Expand Up @@ -131,13 +126,19 @@ public virtual void touchUnchanged(object sender, EventArgs unused)
}

private DS4State remapped = new DS4State();
public bool dragging, dragging2;
private void synthesizeMouseButtons()
{
if (Global.getCustomButton(deviceNum, DS4Controls.TouchLeft) == X360Controls.None &&
Global.getCustomMacro(deviceNum, DS4Controls.TouchLeft) == "0" &&
Global.getCustomKey(deviceNum, DS4Controls.TouchLeft) == 0 &&
leftDown)
{
Mapping.MapClick(deviceNum, Mapping.Click.Left);
dragging2 = true;
}
else
dragging2 = false;
if (Global.getCustomButton(deviceNum, DS4Controls.TouchUpper) == X360Controls.None &&
Global.getCustomMacro(deviceNum, DS4Controls.TouchUpper) == "0" &&
Global.getCustomKey(deviceNum, DS4Controls.TouchUpper) == 0 &&
Expand Down Expand Up @@ -166,7 +167,12 @@ private void synthesizeMouseButtons()
//if it fails the method resets, and tries again with a new tester value (gives tap a delay so tap and hold can work)
}
if (secondtouchbegin) //if tap and hold (also works as double tap)
{
Mapping.MapClick(deviceNum, Mapping.Click.Left);
dragging = true;
}
else
dragging = false;
}
s = remapped;
//remapped.CopyTo(s);
Expand Down
29 changes: 23 additions & 6 deletions DS4Control/MouseCursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public void touchesBegan(TouchpadEventArgs arg)
}

private byte lastTouchID;
public void touchesMoved(TouchpadEventArgs arg)
public void touchesMoved(TouchpadEventArgs arg, bool dragging)
{
if (arg.touches.Length != 1)
if ((!dragging && arg.touches.Length != 0) || (dragging && arg.touches.Length < 1))
return;
int deltaX, deltaY;
if (arg.touches[0].touchID != lastTouchID)
Expand All @@ -46,8 +46,17 @@ public void touchesMoved(TouchpadEventArgs arg)
else if (Global.TouchpadJitterCompensation[deviceNumber])
{
// Often the DS4's internal jitter compensation kicks in and starts hiding changes, ironically creating jitter...
deltaX = arg.touches[0].deltaX;
deltaY = arg.touches[0].deltaY;

if (dragging && arg.touches.Length > 1)
{
deltaX = arg.touches[1].deltaX;
deltaY = arg.touches[1].deltaY;
}
else
{
deltaX = arg.touches[0].deltaX;
deltaY = arg.touches[0].deltaY;
}
// allow only very fine, slow motions, when changing direction, even from neutral
// TODO maybe just consume it completely?
if (deltaX <= -1)
Expand Down Expand Up @@ -86,8 +95,16 @@ public void touchesMoved(TouchpadEventArgs arg)
}
else
{
deltaX = arg.touches[0].deltaX;
deltaY = arg.touches[0].deltaY;
if (dragging && arg.touches.Length > 1)
{
deltaX = arg.touches[1].deltaX;
deltaY = arg.touches[1].deltaY;
}
else
{
deltaX = arg.touches[0].deltaX;
deltaY = arg.touches[0].deltaY;
}
}

double coefficient = Global.TouchSensitivity[deviceNumber] / 100.0;
Expand Down
4 changes: 2 additions & 2 deletions DS4Control/MouseWheel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public void touchesBegan(TouchpadEventArgs arg)
horizontalRemainder = verticalRemainder = 0.0;
}

public void touchesMoved(TouchpadEventArgs arg)
public void touchesMoved(TouchpadEventArgs arg, bool dragging)
{
if (arg.touches.Length != 2)
if (arg.touches.Length != 2 || dragging)
return;
Touch lastT0 = arg.touches[0].previousTouch;
Touch lastT1 = arg.touches[1].previousTouch;
Expand Down
45 changes: 41 additions & 4 deletions DS4Windows.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
<StartupObject>DS4Windows.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>5F2A5A97E42A73158D79996F7F3BE738271F5047</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>2F336030801042E29CD1F9E43E2FEC00D9702E66</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>DS4Tool_TemporaryKey.pfx</ManifestKeyFile>
<ManifestKeyFile>DS4Windows_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
Expand Down Expand Up @@ -213,6 +213,9 @@
<Compile Include="DS4Windows\WinProgs.Designer.cs">
<DependentUpon>WinProgs.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="DS4Windows\DS4Form.tr.resx">
<DependentUpon>DS4Form.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\Alreadyrunning.resx">
<DependentUpon>Alreadyrunning.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -249,6 +252,9 @@
<EmbeddedResource Include="DS4Windows\DupBox.ru-RU.resx">
<DependentUpon>DupBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\DupBox.tr.resx">
<DependentUpon>DupBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\Hotkeys.de-DE.resx">
<DependentUpon>Hotkeys.cs</DependentUpon>
</EmbeddedResource>
Expand All @@ -273,6 +279,9 @@
<EmbeddedResource Include="DS4Windows\Hotkeys.ru-RU.resx">
<DependentUpon>Hotkeys.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\Hotkeys.tr.resx">
<DependentUpon>Hotkeys.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\KBM360.de-DE.resx">
<DependentUpon>KBM360.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -307,6 +316,9 @@
<EmbeddedResource Include="DS4Windows\KBM360.ru-RU.resx">
<DependentUpon>KBM360.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\KBM360.tr.resx">
<DependentUpon>KBM360.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\Options.de-DE.resx">
<DependentUpon>Options.cs</DependentUpon>
</EmbeddedResource>
Expand All @@ -331,21 +343,39 @@
<EmbeddedResource Include="DS4Windows\Options.ru-RU.resx">
<DependentUpon>Options.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\Options.tr.resx">
<DependentUpon>Options.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\RecordBox.ro-RO.resx">
<DependentUpon>RecordBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\RecordBox.tr.resx">
<DependentUpon>RecordBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\SaveWhere.ro-RO.resx">
<DependentUpon>SaveWhere.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\SaveWhere.tr.resx">
<DependentUpon>SaveWhere.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\SpecActions.ro-RO.resx">
<DependentUpon>SpecActions.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\SpecActions.tr.resx">
<DependentUpon>SpecActions.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\WelcomeDialog.ro-RO.resx">
<DependentUpon>WelcomeDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\WelcomeDialog.tr.resx">
<DependentUpon>WelcomeDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\WinProgs.ro-RO.resx">
<DependentUpon>WinProgs.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DS4Windows\WinProgs.tr.resx">
<DependentUpon>WinProgs.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.de-DE.resx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand Down Expand Up @@ -467,11 +497,13 @@
<DependentUpon>WinProgs.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.ro-RO.resx" />
<EmbeddedResource Include="Properties\Resources.tr.resx" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="DS4Windows\app.config" />
<None Include="DS4Windows\DS4Tool_TemporaryKey.pfx" />
<None Include="DS4Windows_TemporaryKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -582,14 +614,19 @@
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Downloads\Ookii.Dialogs\src\Ookii.Dialogs\Ookii.Dialogs.csproj">
<Project>{779e62b3-c5a6-494d-9d87-96c0dec7ffb0}</Project>
<Name>Ookii.Dialogs</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
<PostBuildEvent>ilmerge /targetplatform:"v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319" /out:Build\DS4Windows.exe DS4Windows.exe Ookii.Dialogs.dll</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
6 changes: 6 additions & 0 deletions DS4Windows.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DS4Windows", "DS4Windows.csproj", "{B1081607-B630-4F57-9580-8A4897145890}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ookii.Dialogs", "..\..\..\Downloads\Ookii.Dialogs\src\Ookii.Dialogs\Ookii.Dialogs.csproj", "{779E62B3-C5A6-494D-9D87-96C0DEC7FFB0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{B1081607-B630-4F57-9580-8A4897145890}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1081607-B630-4F57-9580-8A4897145890}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1081607-B630-4F57-9580-8A4897145890}.Release|Any CPU.Build.0 = Release|Any CPU
{779E62B3-C5A6-494D-9D87-96C0DEC7FFB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{779E62B3-C5A6-494D-9D87-96C0DEC7FFB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{779E62B3-C5A6-494D-9D87-96C0DEC7FFB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{779E62B3-C5A6-494D-9D87-96C0DEC7FFB0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion DS4Windows/DS4Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public partial class DS4Form : Form

public DS4Form(string[] args)
{
//System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("fr-FR");
//System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("tr");
InitializeComponent();
arguements = args;
ThemeUtil.SetTheme(lvDebug);
Expand Down
Loading

0 comments on commit 5945185

Please sign in to comment.