Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lessonscreen.py
diff options
context:
space:
mode:
authorWade Brainerd <wadetb@gmail.com>2009-03-09 03:30:12 (GMT)
committer Wade Brainerd <wadetb@gmail.com>2009-03-09 03:30:12 (GMT)
commitc2e093dbb337428d7701960e2ed007876aba1d21 (patch)
treeb07450df7933ad30674e8c9f60e9ad368813567f /lessonscreen.py
parenta2b70d2c0baaf600d05b0c58d59942c7b5696cfd (diff)
Add support for custom key map files. Add key builder.
Diffstat (limited to 'lessonscreen.py')
-rw-r--r--lessonscreen.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lessonscreen.py b/lessonscreen.py
index 33b15eb..4e52579 100644
--- a/lessonscreen.py
+++ b/lessonscreen.py
@@ -127,6 +127,9 @@ class LessonScreen(gtk.VBox):
self.keyboard = keyboard.KeyboardWidget(self.keyboard_images, self.activity)
self.keyboard.set_layout(keyboard.OLPC_LAYOUT)
+ code = locale.getdefaultlocale()[0]
+ self.keyboard.load_key_map('lessons/%s/%s.key' % (code, code))
+
self.pack_start(hbox, False, False, 10)
self.pack_start(frame, True, True)
self.pack_start(self.keyboard, False)
@@ -359,8 +362,9 @@ class LessonScreen(gtk.VBox):
return True
# Extract information about the key pressed.
- key = gtk.gdk.keyval_to_unicode(event.keyval)
- if key != 0: key = unichr(key)
+ key = event.string
+ #key = gtk.gdk.keyval_to_unicode(event.keyval)
+ #if key != 0: key = unichr(key)
key_name = gtk.gdk.keyval_name(event.keyval)
# Convert Return keys to paragraph symbols.