[Hildon-test-aut-commits] r652 - trunk/dogtail/dogtail

manishan at garage.maemo.org manishan at garage.maemo.org
Wed Dec 5 17:51:37 EET 2007


Author: manishan
Date: 2007-12-05 17:51:36 +0200 (Wed, 05 Dec 2007)
New Revision: 652

Modified:
   trunk/dogtail/dogtail/rocknroleN800.py
Log:
Added keySysms for sbox and modified hardkey method

Modified: trunk/dogtail/dogtail/rocknroleN800.py
===================================================================
--- trunk/dogtail/dogtail/rocknroleN800.py	2007-12-05 15:22:56 UTC (rev 651)
+++ trunk/dogtail/dogtail/rocknroleN800.py	2007-12-05 15:51:36 UTC (rev 652)
@@ -130,28 +130,77 @@
  
 }
 
-'''
 sboxsyms = {
+
+        'select' : 0xff0d,
+        'return' : 0xff0d,
+        'enter' : 0xff0d,
+        'esc' : 0xff1b,
+        'escape' : 0xff1b,
+        'space' : 0x20,
+        'up' : 0xff52,
+        'down' : 0xff54,
+        'left' : 0xff51,
+        'right' : 0xff53,
+        'menu' : 0xffc1,
+        'F4' : 0xffc1,
+        'home' : 0xffc2,
+        'F5' : 0xffc2,
+        'minus' : 0xffc5,
+        'F8' : 0xffc5,
+        'zoomminus' : 0xffc5,
+        'zoomout' : 0xffc5,
+        'zoom-' : 0xffc5,
+        'plus' : 0xffc4,
+        'F7' : 0xffc4,
+        'zoomplus' : 0xffc4,
+        'zoom+' : 0xffc4,
+        'zoomin' : 0xffc4,
+        '+' : 0xffc4,
+        'fs' : 0xffc3,
+        'F6' : 0xffc3,
+        'fullscreen' : 0xffc3,
+        'full-screen' : 0xffc3,
+        'full_screen' : 0xffc3,
+        'control' : 0xffe4,
+        'Control_R' : 0xffe4,
+        'ctrl' : 0xffe4,
+        'ctrl-' : 0xffe4,
+        'shift' : 0xffe1,
+        'Shift_L' : 0xffe1,
+        'backspace' : 0xff08, 
+        'linehome' : 0xff50,
+        'line_start' : 0xff50,
+        'lineend' : 0xff57,
+        'End' : 0xff57,
+        'line_end' : 0xff57
+ 
 }
-'''
 
 hardkeySleep = 0.1
 
 if isdevice():
-    def hardkey(key, rep=1) :
-        for i in range(rep) : atspi.EventGenerator().generateKeyboardEvent(devicesyms[key.lower()], "", atspi.SPI_KEY_SYM)
-        sleep(0.1)
-    def hardkeys(args): # provide a list/tuple of hardkeys:repeats - e.g. ('menu', 'right', 'down:2', 'enter')
-        for arg in args :
-            key=arg.split(':')[0]
-            rep=1
-            try :
-                rep=int(arg.split(':')[1])
-            except IndexError : pass
-            for i in range(rep) :
-                atspi.EventGenerator().generateKeyboardEvent(devicesyms[key.lower()], "", atspi.SPI_KEY_SYM)
-                sleep(hardkeySleep)
+    symsDict = devicesyms
+    pidCol = 1
+else:
+    symsDict = sboxsyms
+    pidCol = 2
 
+def hardkey(key, rep=1) :
+    for i in range(rep) : atspi.EventGenerator().generateKeyboardEvent(symsDict[key.lower()], "", atspi.SPI_KEY_SYM)
+    sleep(0.1)
+
+def hardkeys(args): # provide a list/tuple of hardkeys:repeats - e.g. ('menu', 'right', 'down:2', 'enter')
+    for arg in args :
+        key=arg.split(':')[0]
+        rep=1
+        try :
+            rep=int(arg.split(':')[1])
+        except IndexError : pass
+        for i in range(rep) :
+            atspi.EventGenerator().generateKeyboardEvent(symsDict[key.lower()], "", atspi.SPI_KEY_SYM)
+            sleep(hardkeySleep)
+
 # else : # sbox
 # TODO put in dict for sbox later and then matching hardkey definition in else part below.
 #   def hardkey(key, rep=1) :



More information about the Hildon-test-aut-commits mailing list