mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Win32: Allow right mouse button to be bound to anything.
This commit is contained in:
parent
61d2042083
commit
4f76c3f4fb
2 changed files with 19 additions and 1 deletions
|
@ -116,7 +116,9 @@ std::map<int, int> windowsTransTable = InitConstMap<int, int>
|
|||
(VK_F10, NKCODE_F10)
|
||||
(VK_F11, NKCODE_F11)
|
||||
(VK_F12, NKCODE_F12)
|
||||
(VK_OEM_102, NKCODE_EXT_PIPE);
|
||||
(VK_OEM_102, NKCODE_EXT_PIPE)
|
||||
(VK_LBUTTON, NKCODE_EXT_MOUSEBUTTON_1)
|
||||
(VK_RBUTTON, NKCODE_EXT_MOUSEBUTTON_2);
|
||||
|
||||
int KeyboardDevice::UpdateState(InputState &input_state) {
|
||||
// Nothing to do, all done in WM_INPUT
|
||||
|
|
|
@ -1122,6 +1122,22 @@ namespace MainWindow
|
|||
mouseDeltaX += raw->data.mouse.lLastX;
|
||||
mouseDeltaY += raw->data.mouse.lLastY;
|
||||
|
||||
KeyInput key;
|
||||
key.deviceId = DEVICE_ID_MOUSE;
|
||||
|
||||
bool mouseRightBtnPressed = raw->data.mouse.usButtonFlags & RI_MOUSE_RIGHT_BUTTON_DOWN != 0;
|
||||
|
||||
if(mouseRightBtnPressed) {
|
||||
key.flags = KEY_DOWN;
|
||||
key.keyCode = windowsTransTable[VK_RBUTTON];
|
||||
NativeKey(key);
|
||||
}
|
||||
else {
|
||||
key.flags = KEY_UP;
|
||||
key.keyCode = windowsTransTable[VK_RBUTTON];
|
||||
NativeKey(key);
|
||||
}
|
||||
|
||||
// TODO : Smooth and translate to an axis every frame.
|
||||
// NativeAxis()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue