mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-23 23:21:49 +01:00
Attempt to smooth out mouse cursor for analog sticks
This commit is contained in:
parent
5678ee6cd5
commit
328b2dc14c
@ -2322,7 +2322,8 @@ namespace DS4Windows
|
||||
|
||||
int controlNum = (int)control;
|
||||
DS4StateFieldMapping.ControlType controlType = DS4StateFieldMapping.mappedType[controlNum];
|
||||
long timeElapsed = ctrl.DS4Controllers[device].getLastTimeElapsed();
|
||||
//long timeElapsed = ctrl.DS4Controllers[device].getLastTimeElapsed();
|
||||
double timeElapsed = ctrl.DS4Controllers[device].lastTimeElapsedDouble;
|
||||
//double mouseOffset = 0.025;
|
||||
double tempMouseOffsetX = 0.0, tempMouseOffsetY = 0.0;
|
||||
|
||||
|
@ -264,6 +264,12 @@ namespace DS4Windows
|
||||
return lastTimeElapsed;
|
||||
}
|
||||
|
||||
public double lastTimeElapsedDouble = 0.0;
|
||||
public double getLastTimeElapsedDouble()
|
||||
{
|
||||
return lastTimeElapsedDouble;
|
||||
}
|
||||
|
||||
public byte RightLightFastRumble
|
||||
{
|
||||
get { return rightLightFastRumble; }
|
||||
@ -630,10 +636,12 @@ namespace DS4Windows
|
||||
return synced;
|
||||
}
|
||||
|
||||
public double Latency = 0;
|
||||
public double Latency = 0.0;
|
||||
public string error;
|
||||
public bool firstReport = false;
|
||||
public bool oldCharging = false;
|
||||
double curTimeDouble = 0.0;
|
||||
double oldTimeDouble = 0.0;
|
||||
|
||||
private void performDs4Input()
|
||||
{
|
||||
@ -656,12 +664,15 @@ namespace DS4Windows
|
||||
{
|
||||
oldCharging = charging;
|
||||
currerror = string.Empty;
|
||||
curTimeDouble = sw.Elapsed.TotalMilliseconds;
|
||||
curtime = sw.ElapsedMilliseconds;
|
||||
this.lastTimeElapsed = curtime - oldtime;
|
||||
lastTimeElapsed = curtime - oldtime;
|
||||
lastTimeElapsedDouble = (curTimeDouble - oldTimeDouble);
|
||||
//latencyList.Add(this.lastTimeElapsed);
|
||||
latencyQueue.Enqueue(this.lastTimeElapsed);
|
||||
tempLatencyCount++;
|
||||
oldtime = curtime;
|
||||
oldTimeDouble = curTimeDouble;
|
||||
|
||||
if (tempLatencyCount > 50)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user