You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Allow for mapping keycodes to current layout
This commit is contained in:
@@ -309,6 +309,18 @@ unsigned int KeyMappingX11::get_scancode(unsigned int p_code) {
|
||||
return keycode;
|
||||
}
|
||||
|
||||
unsigned int KeyMappingX11::get_xlibcode(unsigned int p_keysym) {
|
||||
unsigned int code = 0;
|
||||
for (int i = 0; _scancode_to_keycode[i].keysym != KEY_UNKNOWN; i++) {
|
||||
if (_scancode_to_keycode[i].keysym == p_keysym) {
|
||||
code = _scancode_to_keycode[i].keycode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
Key KeyMappingX11::get_keycode(KeySym p_keysym) {
|
||||
// kinda bruteforce.. could optimize.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user