mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 09:13:39 +01:00
OpenXR - Accept scrolling from both controllers
This commit is contained in:
1 parent
940a669107
commit
c7bcfe9fe9
1 file changed
+10
-8
+10
-8
@@ -347,14 +347,16 @@ void UpdateVRInput(bool(*NativeAxis)(const AxisInput &axis), bool(*NativeKey)(co
|
||||
}
|
||||
|
||||
//mouse wheel emulation
|
||||
keyInput.deviceId = controllerIds[mouseController];
|
||||
float scroll = -IN_VRGetJoystickState(mouseController).y;
|
||||
keyInput.flags = scroll < -0.5f ? KEY_DOWN : KEY_UP;
|
||||
keyInput.keyCode = NKCODE_EXT_MOUSEWHEEL_UP;
|
||||
NativeKey(keyInput);
|
||||
keyInput.flags = scroll > 0.5f ? KEY_DOWN : KEY_UP;
|
||||
keyInput.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN;
|
||||
NativeKey(keyInput);
|
||||
for (int j = 0; j < 2; j++) {
|
||||
keyInput.deviceId = controllerIds[j];
|
||||
float scroll = -IN_VRGetJoystickState(j).y;
|
||||
keyInput.flags = scroll < -0.5f ? KEY_DOWN : KEY_UP;
|
||||
keyInput.keyCode = NKCODE_EXT_MOUSEWHEEL_UP;
|
||||
NativeKey(keyInput);
|
||||
keyInput.flags = scroll > 0.5f ? KEY_DOWN : KEY_UP;
|
||||
keyInput.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN;
|
||||
NativeKey(keyInput);
|
||||
}
|
||||
} else {
|
||||
VR_SetConfig(VR_CONFIG_MOUSE_SIZE, 0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user