Skip to content

Commit 30c1c56

Browse files
vantu5zDavidy22
authored andcommitted
use keycode for keybinding
1 parent a218dad commit 30c1c56

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

guake/keybindings.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,8 @@ def reload_global(self, settings, key, user_data):
230230
def activate(self, window, event):
231231
"""If keystroke matches a key binding, activate keybinding. Otherwise, allow
232232
keystroke to pass through."""
233-
key = event.keyval
233+
key = event.hardware_keycode
234234
mod = event.state
235-
if mod & Gdk.ModifierType.SHIFT_MASK:
236-
if key == Gdk.KEY_ISO_Left_Tab:
237-
key = Gdk.KEY_Tab
238-
else:
239-
key = Gdk.keyval_to_lower(key)
240-
else:
241-
keys = Gdk.keyval_convert_case(key)
242-
if key != keys[1]:
243-
key = keys[0]
244-
mod &= ~Gdk.ModifierType.SHIFT_MASK
245235

246236
mask = mod & self._masks
247237

@@ -266,11 +256,10 @@ def load_accelerators(self):
266256
"""Reads all gconf paths under /apps/guake/keybindings/local
267257
and adds to the _lookup.
268258
"""
269-
270259
for binding, action in self.keys:
271-
key, mask = Gtk.accelerator_parse(
260+
key, keycodes, mask = Gtk.accelerator_parse_with_keycode(
272261
self.guake.settings.keybindingsLocal.get_string(binding)
273262
)
274-
if key > 0:
275-
self._lookup[mask][key] = action
263+
if keycodes and keycodes[0]:
264+
self._lookup[mask][keycodes[0]] = action
276265
self._masks |= mask

0 commit comments

Comments
 (0)