Skip to content

Commit

Permalink
#4396 safer lookup
Browse files Browse the repository at this point in the history
let the find_matching_keycode fall through use the keycode_translation for non X11 clients,
as this may require using a different group
  • Loading branch information
totaam committed Oct 28, 2024
1 parent fb72d90 commit 730e45e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions xpra/x11/server/keyboard_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,10 @@ def do_get_keycode(self, client_keycode: int, keyname: str, pressed: bool, modif
return -1, group
if self.raw:
return client_keycode, group
keycode = self.keycode_translation.get((client_keycode, keyname), -1)
if keycode >= 0:
if self.x11_keycodes and client_keycode > 0:
keycode = self.keycode_translation.get((client_keycode, keyname), 0) or client_keycode
kmlog(keyname, "do_get_keycode (%i, %s)=%s (native keymap)", client_keycode, keyname, keycode)
return keycode, group
if self.x11_keycodes and client_keycode >= 0:
return client_keycode, group
return self.find_matching_keycode(client_keycode, keyname, pressed, modifiers, keyval, keystr, group)

def find_matching_keycode(self, client_keycode: int, keyname: str,
Expand Down

0 comments on commit 730e45e

Please sign in to comment.