Allow for mapping keycodes to current layout
This commit is contained in:
parent
2d1699ef82
commit
650e63a7ca
13 changed files with 250 additions and 135 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue