Skip to content

Commit

Permalink
add new button handler for system button on the left controller
Browse files Browse the repository at this point in the history
- when used in gzdoomvr mode will behave like Backspace
- when used in questzdoom mode will behave like Left Ctrl
  • Loading branch information
emawind84 committed Aug 19, 2024
1 parent 36b6fdc commit 7c86c11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rendering/gl/stereo3d/gl_openvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1570,6 +1570,9 @@ namespace s3d

// k_EButton_Axis4 (unknown if used by any controller at all)
HandleVRButton(lastState, newState, openvr::vr::k_EButton_Axis4, KEY_JOY3, role * (KEY_JOY4 - KEY_JOY3));

// k_EButton_System
HandleVRButton(lastState, newState, openvr::vr::k_EButton_System, KEY_BACKSPACE, role);
}

lastState = newState;
Expand Down Expand Up @@ -1836,6 +1839,12 @@ namespace s3d
static int joy_mode = vr_joy_mode;
if (joy_mode == 1)
{
//Menu button - invoke menu
Joy_GenerateButtonEvents(
((pSecondaryTrackedRemoteOld->ulButtonPressed & ButtonMaskFromId(openvr::vr::k_EButton_System)) != 0),
((pSecondaryTrackedRemoteNew->ulButtonPressed & ButtonMaskFromId(openvr::vr::k_EButton_System)) != 0),
1, KEY_LCTRL);

//if in cinema mode, then the dominant joystick is used differently
if (!VR_UseScreenLayer() && axisJoystick != -1)
{
Expand Down

0 comments on commit 7c86c11

Please sign in to comment.