mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-26 00:21:48 +01:00
f8dd4c6cba
Added Presets for Dpad, Left and Right Sticks, Face Buttons, Sixaxis, and Touchpad Swipes; right click on those controls to select a preset) Fully fixed Scan code, now will work fine in old DirectX games Macros for Special Actions can now have scan code enabled (if you didn't know you can enable scan code on macros for single controls as well, even after you've configured the macro) Control list now shows if scan code is enabled
48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.ServiceProcess;
|
|
using DS4Control;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using System.Reflection;
|
|
namespace DS4Service
|
|
{
|
|
public partial class DS4Service : ServiceBase
|
|
{
|
|
private Control rootHub;
|
|
StreamWriter logWriter;
|
|
string logFile = Global.appdatapath + @"\DS4Service.log";
|
|
public DS4Service()
|
|
{
|
|
InitializeComponent();
|
|
rootHub = new Control();
|
|
rootHub.Debug += On_Debug;
|
|
logWriter = File.AppendText(logFile);
|
|
}
|
|
|
|
public DS4Service(Control scpdevice)
|
|
{
|
|
InitializeComponent();
|
|
rootHub = scpdevice;
|
|
rootHub.Debug += On_Debug;
|
|
logWriter = File.AppendText(logFile);
|
|
}
|
|
|
|
protected override void OnStart(string[] args)
|
|
{
|
|
rootHub.Start();
|
|
}
|
|
|
|
protected override void OnStop()
|
|
{
|
|
rootHub.Stop();
|
|
}
|
|
|
|
protected void On_Debug(object sender, DebugEventArgs e)
|
|
{
|
|
logWriter.WriteLine(e.Time + ":\t" + e.Data);
|
|
logWriter.Flush();
|
|
}
|
|
}
|
|
}
|