Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/keybindings.py
blob: bb4b07d8ef9f0da048b8285b0ee006f6caf4b6d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()