Fixed some bindings and added tweaks.

The volume slider is now the Z axis and the touchpad (if configured like a joystick) is more accurate. If the touchpad is lifted off of, then the RX and RY axis will center (like taking your thumb off a real joystick)
This commit is contained in:
RedInquisitive 2015-10-03 21:25:41 -05:00
parent 82917a0437
commit ef7b8c2c9e
3 changed files with 19 additions and 8 deletions

View File

@ -23,8 +23,8 @@ Make sure to use a single space, not a tab for seperating settings,
Port: 8889
Throttle: 20
Circle Pad: JOYSTICK1
C Stick: JOYSTICK2
Touch: MOUSE
C Stick: MOUSE
Touch: JOYSTICK2
Mouse Speed: 4
A: JOY1

View File

@ -13,7 +13,8 @@
#define joyY iReport.wAxisY
#define joyRX iReport.wAxisXRot
#define joyRY iReport.wAxisYRot
#define joyVolume iReport.wSlider
//#define joyVolume iReport.wSlider
#define joyVolume iReport.wAxisZ
#define povHat iReport.bHats
#define joyButtons iReport.lButtons

View File

@ -167,18 +167,28 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmd, int nShow)
SetCursorPos((int)((double)currentTouch.x * widthMultiplier), (int)((double)currentTouch.y * heightMultiplier));
}
}
else if(settings.touch == joystick1) {
joyX = (currentTouch.x) * 128;
joyY = (currentTouch.y) * 128;
else if(settings.touch == joystick1) { //made a little bit more accurate to the screen size.
joyX = (int)((float)(currentTouch.x) * 102.3f);
joyY = (int)((float)(currentTouch.y) * 136.5f);
}
else if(settings.touch == joystick2) {
joyRX = (currentTouch.x) * 128;
joyRY = (currentTouch.y) * 128;
joyRX = (int)((float)(currentTouch.x) * 102.3f);
joyRY = (int)((float)(currentTouch.y) * 136.5f);
}
else {
handleKey(KEY_TOUCH, settings.Tap);
}
} else { //If we are not touching, move to center (Like if you release the joystick on a normal controller).
if(settings.touch == joystick1) {
joyX = 16383; //Halfway between the x
joyY = 16383; //Halfway between the y
}
else if(settings.touch == joystick2) {
joyRX = 16383; //Halfway between the rx
joyRY = 16383; //Halfway between the ry
}
}
if(settings.circlePad == mouse) {