OpenXR - Use mouse control only

This commit is contained in:
Lubos committed 2022-11-17 12:19:17 +01:00
1 parent ddad6b3760
commit 011592754f
6 files changed
+87 -36

No files matched your search

+10 -2
View File
@@ -826,13 +826,21 @@ bool ScrollView::Key(const KeyInput &input) {
if (visibility_ != V_VISIBLE)
return ViewGroup::Key(input);
float scrollSpeed = 250;
switch (input.deviceId) {
case DEVICE_ID_XR_CONTROLLER_LEFT:
case DEVICE_ID_XR_CONTROLLER_RIGHT:
scrollSpeed = 50;
break;
}
if (input.flags & KEY_DOWN) {
switch (input.keyCode) {
case NKCODE_EXT_MOUSEWHEEL_UP:
ScrollRelative(-250);
ScrollRelative(-scrollSpeed);
break;
case NKCODE_EXT_MOUSEWHEEL_DOWN:
ScrollRelative(250);
ScrollRelative(scrollSpeed);
break;
}
}