accerciser r575 - in trunk/macaroon: . macaroon/playback



Author: eitani
Date: Thu Jun  5 19:39:14 2008
New Revision: 575
URL: http://svn.gnome.org/viewvc/accerciser?rev=575&view=rev

Log:
* macaroon/playback/keypress_actions.py (TypeAction._charType): 
  Press "shift" if the character is uppercase, I don't know if
  this is a very localizable solution, but what the hell.


Modified:
   trunk/macaroon/ChangeLog
   trunk/macaroon/macaroon/playback/keypress_actions.py

Modified: trunk/macaroon/macaroon/playback/keypress_actions.py
==============================================================================
--- trunk/macaroon/macaroon/playback/keypress_actions.py	(original)
+++ trunk/macaroon/macaroon/playback/keypress_actions.py	Thu Jun  5 19:39:14 2008
@@ -256,19 +256,27 @@
     interval = 0
     for char in string_to_type:
       key_code = utils.getKeyCodeFromVal(gtk.gdk.unicode_to_keyval(ord(char)))
-      gobject.timeout_add(interval, self._charType, key_code)
+      gobject.timeout_add(interval, self._charType, key_code, char.isupper())
       interval += self.interval 
     gobject.timeout_add(interval, self.stepDone)
 
-  def _charType(self, key_code):
+  def _charType(self, key_code, upper):
     '''
     Type a single character.
     
     @param key_code: Key code to type.
     @type key_code: intger
+    @param upper: Is the character uppercase?
+    @type upper: 
     '''
+    if upper:
+        pyatspi.Registry.generateKeyboardEvent(50, None, 
+                                               pyatspi.KEY_PRESS)
     pyatspi.Registry.generateKeyboardEvent(key_code, None, 
                                            pyatspi.KEY_PRESSRELEASE)
+    if upper:
+        pyatspi.Registry.generateKeyboardEvent(50, None, 
+                                               pyatspi.KEY_RELEASE)
     return False
 
   def __str__(self):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]