[orca] Remove the custom checkKeyboardEventData() from the Clutter script
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Remove the custom checkKeyboardEventData() from the Clutter script
- Date: Mon, 11 Nov 2019 18:52:50 +0000 (UTC)
commit 2247a7de30be5939a8855272685060ed59783056
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Mon Nov 11 13:52:01 2019 -0500
Remove the custom checkKeyboardEventData() from the Clutter script
The code in that method is obsolete. All that's needed is what's in
the generic script.
src/orca/scripts/toolkits/clutter/script.py | 71 -----------------------------
1 file changed, 71 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/clutter/script.py b/src/orca/scripts/toolkits/clutter/script.py
index 5f9fd047e..c2de80f2e 100644
--- a/src/orca/scripts/toolkits/clutter/script.py
+++ b/src/orca/scripts/toolkits/clutter/script.py
@@ -40,74 +40,3 @@ class Script(default.Script):
def getUtilities(self):
return Utilities(self)
-
- def checkKeyboardEventData(self, keyboardEvent):
- """Processes the given keyboard event.
-
- Here is used to:
- * Fill event_string using the key.id
-
- Arguments:
- - keyboardEvent: an instance of input_event.KeyboardEvent
- """
-
- # On the AtkKeyEventStruct documentation you can find this
- # description:
- # guint keyval;
- # A guint representing a keysym value corresponding to those
- # used by GDK
- #
- # There are no Clutter way to get a gdk-like keyvalname.
- # Anyway, cally will fill event_string with the final
- # representation of a text char.
- #
- # In the same way, Clutter provides the keyval without the
- # modifiers, and GDK yes. We will try to apply it, at least
- # to compute keyval_name
- #
- # More information:
- # http://library.gnome.org/devel/atk/stable/AtkUtil.html
- # http://bugzilla.o-hand.com/show_bug.cgi?id=2072
-
- # apply the modifiers to keyboardEvent.id
- #
- keyval = keyboardEvent.id
- try:
- keymap = Gdk.Keymap.get_default()
-
- if keymap:
- success, entries = keymap.get_entries_for_keyval(keyval)
- group = entries[0].group
- modifiers = Gdk.ModifierType(keyboardEvent.modifiers)
- success, keyval, egroup, level, consumed = \
- keymap.translate_keyboard_state (keyboardEvent.hw_code,
- modifiers,
- group)
- except:
- msg = 'ERROR: Exception computing keyval with modifiers'
- debug.println(debug.LEVEL_INFO, msg, True)
-
- msg = 'CLUTTER: Checked keyboard event data: ' \
- 'prev keyval=%d; post keyval=%d' % (keyboardEvent.id, keyval)
- debug.println(debug.LEVEL_INFO, msg, True)
-
- keyboardEvent.id = keyval
-
- # if cally doesn't provide a event_string we get that using
- # Gdk. I know that it will probably called again computing
- # keyval_name but to simplify code, and not start to add
- # guess-code here I will maintain that in this way
- #
- if (keyboardEvent.event_string == ""):
- msg = 'CLUTTER: Keyboard Event event_string is empty. Computing.'
- debug.println(debug.LEVEL_INFO, msg, True)
- try:
- keyboardEvent.event_string = Gdk.keyval_name(keyboardEvent.id)
- msg = 'CLUTTER: New event string: %s' % keyboardEvent.event_string
- debug.println(debug.LEVEL_INFO, msg, True)
- except:
- msg = 'ERROR: Exception obtaining keyval_name for id: %d' \
- % keyboardEvent.id
- debug.println(debug.LEVEL_INFO, msg, True)
-
- return default.Script.checkKeyboardEventData(self, keyboardEvent)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]