[orca] Fix for bgo#578832 - Flash locking modifier key state in braille



commit cec27984d343cacb290af3ee81afd3048f84b7e2
Author: Willie Walker <william walker sun com>
Date:   Fri Jul 31 17:18:35 2009 -0400

    Fix for bgo#578832 - Flash locking modifier key state in braille
    
    This builds upon bgo#576848 to flash the state of the caps lock modifer
    key.  It's currently bound to the settings.enableLockingKeys setting,
    which is currently set via the key echo page.  If users want to
    separate the presentation between speech and braille (e.g., don't
    speak it, but braille it), we can make that change in the 2.29.x cycle.
    Note also that as part of bgo#576848, orca.settings.brailleFlashTime
    can be used to set the time (in milliseconds) that flashed messages
    should appear before reverting back.  A negative number means to
    flash indefinitely.  Finally, pressing a cursor routing key on the
    braille display or a key on the keyboard will also revert the display
    back to its pre-flashed state.

 src/orca/orca.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/orca.py b/src/orca/orca.py
index e8b299b..e69c357 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -595,11 +595,16 @@ def keyEcho(event):
 
             modifiers = event.modifiers
 
+            brailleMessage = None
             if event_string == "Caps_Lock":
                 if modifiers & (1 << pyatspi.MODIFIER_SHIFTLOCK):
                     eventType = KeyEventType.LOCKING_UNLOCKED
+                    brailleMessage = keynames.getKeyName(event_string) \
+                                     + " " + _("off")
                 else:
                     eventType = KeyEventType.LOCKING_LOCKED
+                    brailleMessage = keynames.getKeyName(event_string) \
+                                     + " " + _("on")
 
             elif event_string == "Num_Lock":
                 # [[[TODO: richb - we are not getting a correct modifier
@@ -613,6 +618,10 @@ def keyEcho(event):
                 #    eventType = KeyEventType.LOCKING_LOCKED
                 pass
 
+            if brailleMessage:
+                braille.displayMessage(brailleMessage,
+                                       flashTime=settings.brailleFlashTime)
+
         elif isFunctionKey(event_string):
             if not settings.enableFunctionKeys:
                 return False



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