mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 16:46:31 +00:00
detect numpad modifier and add appropriate offset to keycode
This commit is contained in:
parent
3121b51d22
commit
0ad380ded0
@ -99,6 +99,15 @@ static uint32_t GetTranslatedKeyCode(const pp::KeyboardInputEvent& event) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We have to handle the ISKEYPAD modifier on macOS, and convert them
|
||||||
|
// to the correct numpad keycodes for Windows.
|
||||||
|
int32_t num = event.GetKeyCode() - 0x30;
|
||||||
|
if ((event.GetModifiers() & PP_INPUTEVENT_MODIFIER_ISKEYPAD) &&
|
||||||
|
num >= 0 && num <= 9) {
|
||||||
|
// Offset with numpad 0's virtual keycode
|
||||||
|
return num + 0x60;
|
||||||
|
}
|
||||||
|
|
||||||
return event.GetKeyCode();
|
return event.GetKeyCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user