[polari] entryArea: Filter out "activation" keys as well



commit ea3bd6089afa2a25b0a2e12ee78783380a50a792
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Apr 14 20:05:27 2014 +0200

    entryArea: Filter out "activation" keys as well
    
    For convenience, keyboard focus is moved to the main input entry
    automatically on typing. We already ignore non-printable key values
    and keystrokes with modifiers to not interfere with keynav and
    shortcuts, do the same with key values that are commonly used to
    activate widgets via keyboard.

 src/entryArea.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/entryArea.js b/src/entryArea.js
index ea02e45..52a0713 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -119,6 +119,15 @@ const EntryArea = new Lang.Class({
         if (state != 0)
             return Gdk.EVENT_PROPAGATE;
 
+        let activationKeys = [
+            Gdk.KEY_Tab,
+            Gdk.KEY_Return,
+            Gdk.KEY_ISO_Enter,
+            Gdk.KEY_space
+        ];
+        if (activationKeys.indexOf(keyval) != -1)
+            return Gdk.EVENT_PROPAGATE;
+
         this._entry.editable = false;
         this._entry.grab_focus();
         this._entry.editable = true;


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