diff options
Diffstat (limited to 'sugar/keybindings.py')
-rw-r--r-- | sugar/keybindings.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sugar/keybindings.py b/sugar/keybindings.py new file mode 100644 index 0000000..bb4b07d --- /dev/null +++ b/sugar/keybindings.py @@ -0,0 +1,19 @@ +import gtk +import dbus + +# FIXME These should be handled by the wm, but it's incovenient +# to do that with matchbox at the moment + +def setup_global_keys(window, shell = None): + if not shell: + bus = dbus.SessionBus() + proxy_obj = bus.get_object('com.redhat.Sugar.Shell', '/com/redhat/Sugar/Shell') + shell = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Shell') + + window.connect("key-press-event", __key_press_event_cb, shell) + +def __key_press_event_cb(window, event, shell): + if event.keyval == gtk.keysyms.F2: + shell.toggle_people() + if event.keyval == gtk.keysyms.F3: + shell.toggle_console() |