Support for absolute mouse movement
This commit is contained in:
parent
482bf75169
commit
5549cda53a
2 changed files with 15 additions and 4 deletions
|
@ -9,7 +9,7 @@ Port: 8889
|
|||
Throttle: 20
|
||||
Circle Pad: JOYSTICK
|
||||
Touch: MOUSE
|
||||
Mouse Speed: 4
|
||||
Mouse Speed: 0
|
||||
A: A
|
||||
B: B
|
||||
X: X
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow) {
|
||||
printf("3DS Controller Server %.1f\n", VERSION);
|
||||
|
||||
DWORD screenWidth = GetSystemMetrics(SM_CXSCREEN);
|
||||
DWORD screenHeight = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
double widthMultiplier = screenWidth / 320.0;
|
||||
double heightMultiplier = screenHeight / 240.0;
|
||||
|
||||
bool vJoy = true;
|
||||
UINT iInterface = 1;
|
||||
|
||||
|
@ -129,9 +135,14 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
|
|||
}
|
||||
}
|
||||
else if(settings.touch == mouse) {
|
||||
POINT p;
|
||||
GetCursorPos(&p);
|
||||
SetCursorPos(p.x + (currentTouch.x - lastTouch.x) * settings.mouseSpeed, p.y + (currentTouch.y - lastTouch.y) * settings.mouseSpeed);
|
||||
if(settings.mouseSpeed) {
|
||||
POINT p;
|
||||
GetCursorPos(&p);
|
||||
SetCursorPos(p.x + (currentTouch.x - lastTouch.x) * settings.mouseSpeed, p.y + (currentTouch.y - lastTouch.y) * settings.mouseSpeed);
|
||||
}
|
||||
else {
|
||||
SetCursorPos((int)((double)currentTouch.x * widthMultiplier), (int)((double)currentTouch.y * heightMultiplier));
|
||||
}
|
||||
}
|
||||
else if(settings.touch == joystick) {
|
||||
if(vJoy) updateJoystick((currentTouch.x) * 128, (currentTouch.y) * 128);
|
||||
|
|
Loading…
Reference in a new issue