[orca] Remove is_text from input-event processing



commit ebc3b2ed86f6df63630bf5babcc7e7d39300ced5
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Nov 11 13:45:19 2019 -0500

    Remove is_text from input-event processing
    
    Implementors don't always bother, and we don't use it anyway.

 src/orca/input_event.py                     |  3 ---
 src/orca/scripts/toolkits/clutter/script.py | 40 -----------------------------
 2 files changed, 43 deletions(-)
---
diff --git a/src/orca/input_event.py b/src/orca/input_event.py
index abd4d3514..0df0d6485 100644
--- a/src/orca/input_event.py
+++ b/src/orca/input_event.py
@@ -104,7 +104,6 @@ class KeyboardEvent(InputEvent):
         self.modifiers = event.modifiers
         self.event_string = event.event_string
         self.keyval_name = ""
-        self.is_text = event.is_text
         self.timestamp = event.timestamp
         self.is_duplicate = self in [orca_state.lastInputEvent,
                                      orca_state.lastNonModifierKeyEvent]
@@ -262,7 +261,6 @@ class KeyboardEvent(InputEvent):
              + ("                 modifiers=%d\n" % self.modifiers) \
              + ("                 event_string=(%s)\n" % self.event_string) \
              + ("                 keyval_name=(%s)\n" % self.keyval_name) \
-             + ("                 is_text=%s\n" % self.is_text) \
              + ("                 timestamp=%d\n" % self.timestamp) \
              + ("                 time=%f\n" % time.time()) \
              + ("                 keyType=%s\n" % self.keyType) \
@@ -296,7 +294,6 @@ class KeyboardEvent(InputEvent):
             and self.modifiers == other.modifiers \
             and self.event_string == other.event_string \
             and self.keyval_name == other.keyval_name \
-            and self.is_text == other.is_text \
             and self.keyType == other.keyType \
             and self._clickCount == other._clickCount
 
diff --git a/src/orca/scripts/toolkits/clutter/script.py b/src/orca/scripts/toolkits/clutter/script.py
index 307457384..5f9fd047e 100644
--- a/src/orca/scripts/toolkits/clutter/script.py
+++ b/src/orca/scripts/toolkits/clutter/script.py
@@ -32,39 +32,6 @@ import orca.scripts.default as default
 import orca.debug as debug
 from .script_utilities import Utilities
 
-# Set with non printable unicode categories. Full table:
-# http://www.fileformat.info/info/unicode/category/index.htm
-non_printable_set = ('Cc', 'Cf', 'Cn', 'Co', 'Cs')
-
-def _unicharIsPrint(unichar):
-    """ Checks if the unichar is printable
-
-    Equivalent to g_unichar_isprint
-
-    Arguments:
-    - unichar: unichar to check if it is printable
-    """
-    try:
-        import unicodedata
-        category = unicodedata.category (unichar)
-        result = category not in non_printable_set
-    except:
-        # Normally a exception is because there are a string
-        # instead of a single unicode, 'Control_L'
-        result = False
-
-    return result
-
-def _computeIsText(string):
-    """Decides if the string representation of a keyboard event is
-    text or not
-
-    Based on the at-spi equivalent code.
-
-    Arguments:
-    - string: a string representation of a keyboardEvent.
-    """
-    return string and _unicharIsPrint(string)
 
 class Script(default.Script):
 
@@ -79,7 +46,6 @@ class Script(default.Script):
 
         Here is used to:
         * Fill event_string using the key.id
-        * Set the is_text properly
 
         Arguments:
         - keyboardEvent: an instance of input_event.KeyboardEvent
@@ -144,10 +110,4 @@ class Script(default.Script):
                       % keyboardEvent.id
                 debug.println(debug.LEVEL_INFO, msg, True)
 
-            # at-spi uses event_string to compute is_text, so if it is
-            # NULL we should compute again with the proper
-            # event_string
-            #
-            keyboardEvent.is_text = _computeIsText(keyboardEvent.event_string)
-
         return default.Script.checkKeyboardEventData(self, keyboardEvent)


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