From 894ba31880992bfea06be92497a92b71c134da3c Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Fri, 15 Aug 2008 16:20:08 +0100 Subject: [PATCH] Handle case changing better. F now works like f rather than F --- terminatorlib/keybindings.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/terminatorlib/keybindings.py b/terminatorlib/keybindings.py index 539a9baf..79f1ecf0 100644 --- a/terminatorlib/keybindings.py +++ b/terminatorlib/keybindings.py @@ -41,9 +41,17 @@ class TerminatorKeybindings: e.action = action raise e else: - if keyval == gtk.keysyms.Tab and mask & gtk.gdk.SHIFT_MASK: - keyval = gtk.keysyms.ISO_Left_Tab - mask &= ~gtk.gdk.SHIFT_MASK + if mask & gtk.gdk.SHIFT_MASK: + if keyval == gtk.keysyms.Tab: + keyval = gtk.keysyms.ISO_Left_Tab + mask &= ~gtk.gdk.SHIFT_MASK + else: + keyvals = gtk.gdk.keyval_convert_case(keyval) + if keyvals[0] != keyvals[1]: + keyval = keyvals[1] + mask &= ~gtk.gdk.SHIFT_MASK + else: + keyval = gtk.gdk.keyval_to_lower(keyval) self._lookup.setdefault(mask, {}) self._lookup[mask][keyval] = action self._masks |= mask