Configurable mouse speed
This commit is contained in:
parent
9778656ef2
commit
c5d1fe07cf
4 changed files with 9 additions and 2 deletions
|
@ -9,6 +9,7 @@ Throttle: 20
|
|||
Port: 8889
|
||||
Circle Pad: JOYSTICK
|
||||
Touch: MOUSE
|
||||
Mouse Speed: 4
|
||||
A: A
|
||||
B: B
|
||||
X: X
|
||||
|
|
|
@ -11,6 +11,7 @@ struct settings {
|
|||
int throttle;
|
||||
enum analogue circlePad;
|
||||
enum analogue touch;
|
||||
int mouseSpeed;
|
||||
int A, B, X, Y, L, R, Left, Right, Up, Down, Start, Select, Tap;
|
||||
};
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
|
|||
if(settings.touch == mouse) {
|
||||
POINT p;
|
||||
GetCursorPos(&p);
|
||||
SetCursorPos(p.x + (currentTouch.x - lastTouch.x), p.y + (currentTouch.y - lastTouch.y));
|
||||
SetCursorPos(p.x + (currentTouch.x - lastTouch.x) * settings.mouseSpeed, p.y + (currentTouch.y - lastTouch.y) * settings.mouseSpeed);
|
||||
}
|
||||
else if(settings.touch == joystick) {
|
||||
if(vJoy) updateJoystick((currentTouch.x) * 128, (240 - currentTouch.y) * 128);
|
||||
|
@ -130,7 +130,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
|
|||
if(settings.circlePad == mouse) {
|
||||
POINT p;
|
||||
GetCursorPos(&p);
|
||||
SetCursorPos(p.x + circlePad.x / 32, p.y - circlePad.y / 32);
|
||||
SetCursorPos(p.x + (circlePad.x * settings.mouseSpeed) / 32, p.y - (circlePad.y * settings.mouseSpeed) / 32);
|
||||
}
|
||||
else if(settings.circlePad == joystick) {
|
||||
if(vJoy) updateJoystick((circlePad.x + 128) * 128, (128 - circlePad.y) * 128);
|
||||
|
|
|
@ -12,6 +12,7 @@ struct settings defaultSettings = {
|
|||
throttle: 20,
|
||||
circlePad: joystick,
|
||||
touch: mouse,
|
||||
mouseSpeed: 4,
|
||||
A: 'A',
|
||||
B: 'B',
|
||||
X: 'X',
|
||||
|
@ -110,6 +111,10 @@ bool readSettings(void) {
|
|||
else if(strcmp(setting, "JOYSTICK") == 0) settings.touch = joystick;
|
||||
}
|
||||
|
||||
if(getSetting("Mouse Speed: ", buffer, setting)) {
|
||||
sscanf(setting, "%d", &settings.mouseSpeed);
|
||||
}
|
||||
|
||||
if(getSetting("A: ", buffer, setting)) settings.A = getButton(setting);
|
||||
if(getSetting("B: ", buffer, setting)) settings.B = getButton(setting);
|
||||
if(getSetting("X: ", buffer, setting)) settings.X = getButton(setting);
|
||||
|
|
Loading…
Reference in a new issue