diff --git a/PC/3DSController.ini b/PC/3DSController.ini index dae9366..f712a05 100644 --- a/PC/3DSController.ini +++ b/PC/3DSController.ini @@ -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 diff --git a/PC/source/main.c b/PC/source/main.c index c9ef4eb..949494e 100644 --- a/PC/source/main.c +++ b/PC/source/main.c @@ -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);