From 0608413b9679d7277494c2f14f62cb2ed9acefc1 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 14 Feb 2018 12:39:27 +0100 Subject: [PATCH] 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. https://gitlab.gnome.org/GNOME/gnome-shell/issues/46 --- 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();