[gnome-shell/wip/carlosg/fix-issue-46: 1/7] keyboard: Do key presses on actual key press



commit 2a72d78bc47bdc9dc0bbe6fe344e156ca5fadd3e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Feb 14 12:39:27 2018 +0100

    keyboard: Do key presses on actual key press
    
    It was mistakenly connecting twice to the 'released' signal. Also, move
    level changes to key release, since it will be more convenient to hook
    latched states on long press.

 js/ui/keyboard.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 5864fd5f5..270166997 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -807,14 +807,14 @@ var Keyboard = new Lang.Class({
 
             let actor = extraButton.keyButton;
 
+            extraButton.connect('pressed', Lang.bind(this, function() {
+                if (keyval != null)
+                    this._keyboardController.keyvalPress(keyval);
+            }));
             extraButton.connect('released', Lang.bind(this, function() {
                 if (switchToLevel != null)
                     this._onLevelChanged(switchToLevel);
                 else if (keyval != null)
-                    this._keyboardController.keyvalPress(keyval);
-            }));
-            extraButton.connect('released', Lang.bind(this, function() {
-                if (keyval != null)
                     this._keyboardController.keyvalRelease(keyval);
                 else if (action == 'hide')
                     this.hide();


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