diff options
author | Ben Konrath <ben@bagu.org> | 2009-11-19 14:10:22 -0500 |
---|---|---|
committer | Ben Konrath <ben@bagu.org> | 2009-11-19 14:10:22 -0500 |
commit | bfcb018047ce7f295529bac2022a6e8cbfb4bdc2 (patch) | |
tree | a368ef6ebc0532dda5df55400ca1ce4fb7214dd9 | |
parent | be727a8219cf9e72c5033f69cc8511bba9e64149 (diff) | |
download | caribou-bfcb018047ce7f295529bac2022a6e8cbfb4bdc2.tar.gz |
use button label for shift action
-rw-r--r-- | src/keyboard.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/keyboard.py b/src/keyboard.py index 6f059bf..2c8f0b7 100644 --- a/src/keyboard.py +++ b/src/keyboard.py @@ -34,7 +34,7 @@ class CaribouKeyboard(gtk.Frame): # check if this key is a layout switch key or not if isinstance(key[1], str): # switch layout key - button.connect("clicked", lambda w, d: self.__switch_layout(d), key[0]) + button.connect("clicked", self.__change_layout, key[1]) else: # regular key button.connect("clicked", lambda w, d: self.__send_keysym(d), key[1]) @@ -58,12 +58,13 @@ class CaribouKeyboard(gtk.Frame): self._vk.press_keysym(keysym) self._vk.release_keysym(keysym) - def __switch_layout(self, data): - if data == "⇧": + def __change_layout(self, widget, data): + label = widget.get_label() + if label == "⇧": self.remove(self._layouts[0]) self.add(self._layouts[1]) self.show_all() - elif data == "⇩": + elif label == "⇩": self.remove(self._layouts[1]) self.add(self._layouts[0]) self.show_all() |