mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-22 17:29:18 +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)
|
||||||
{
|
{
|
||||||
|
now = DateTime.Now;
|
||||||
|
if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain)
|
||||||
|
{
|
||||||
|
oldnow = now;
|
||||||
InputMethods.performSCKeyPress(kvp.Key);
|
InputMethods.performSCKeyPress(kvp.Key);
|
||||||
Thread.Sleep(25);
|
}
|
||||||
}
|
}
|
||||||
else if (pressagain)
|
else if (pressagain)
|
||||||
{
|
{
|
||||||
|
now = DateTime.Now;
|
||||||
|
if (now >= oldnow + TimeSpan.FromMilliseconds(25) && pressagain)
|
||||||
|
{
|
||||||
|
oldnow = now;
|
||||||
InputMethods.performKeyPress(kvp.Key);
|
InputMethods.performKeyPress(kvp.Key);
|
||||||
Thread.Sleep(25);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user