Allow for mapping keycodes to current layout

This commit is contained in:
Frixuu
2021-09-17 03:07:59 +02:00
parent 2d1699ef82
commit 650e63a7ca
13 changed files with 250 additions and 135 deletions

View File

@@ -345,6 +345,16 @@ unsigned int KeyMappingWindows::get_keysym(unsigned int p_code) {
return KEY_UNKNOWN;
}
unsigned int KeyMappingWindows::get_scancode(Key p_keycode) {
for (int i = 0; _scancode_to_keycode[i].keysym != KEY_UNKNOWN; i++) {
if (_scancode_to_keycode[i].keysym == p_keycode) {
return _scancode_to_keycode[i].keycode;
}
}
return 0;
}
unsigned int KeyMappingWindows::get_scansym(unsigned int p_code, bool p_extended) {
unsigned int keycode = KEY_UNKNOWN;
for (int i = 0; _scancode_to_keycode[i].keysym != KEY_UNKNOWN; i++) {