mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 02:54:20 +01:00
Exchanged thread.sleep for datetime check to speed up operations
This commit is contained in:
parent
c52929f5fa
commit
d88928905d
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using DS4Library;
|
using DS4Library;
|
||||||
using System.Threading;
|
|
||||||
namespace DS4Control
|
namespace DS4Control
|
||||||
{
|
{
|
||||||
public class Mapping
|
public class Mapping
|
||||||
@ -161,13 +160,21 @@ namespace DS4Control
|
|||||||
}
|
}
|
||||||
if (pressagain && gkp.current.scanCodeCount != 0)
|
if (pressagain && gkp.current.scanCodeCount != 0)
|
||||||
{
|
{
|
||||||
InputMethods.performSCKeyPress(kvp.Key);
|
now = DateTime.Now;
|
||||||
Thread.Sleep(25);
|
if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain)
|
||||||
|
{
|
||||||
|
oldnow = now;
|
||||||
|
InputMethods.performSCKeyPress(kvp.Key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (pressagain)
|
else if (pressagain)
|
||||||
{
|
{
|
||||||
InputMethods.performKeyPress(kvp.Key);
|
now = DateTime.Now;
|
||||||
Thread.Sleep(25);
|
if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain)
|
||||||
|
{
|
||||||
|
oldnow = now;
|
||||||
|
InputMethods.performKeyPress(kvp.Key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user