diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index e13c7b72471fd0575856dd5c703336fce5e88171..20908f2a2a87cda11a304d2f3c04ba3587949236 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -312,6 +312,7 @@ var Key = new Lang.Class({ if (this._extended_keys.length > 0) { this._touchPressed = false; + this._mousePressed = false; this.keyButton.set_hover(false); this.keyButton.fake_release(); this._ensureExtendedKeysPopup(); @@ -386,10 +387,17 @@ var Key = new Lang.Class({ button.keyWidth = 1; button.connect('button-press-event', () => { this._press(key); + this._mousePressed = true; return Clutter.EVENT_PROPAGATE; }); button.connect('button-release-event', () => { + if (this._mousePressed == false) { + // This is required in order to activate an extended key + // in case the user keeps the mouse pressed. + this._press(key); + } this._release(key); + this._mousePressed = false; return Clutter.EVENT_PROPAGATE; }); button.connect('touch-event', (actor, event) => { @@ -417,6 +425,13 @@ var Key = new Lang.Class({ device.sequence_ungrab(sequence); this._touchPressed = false; this._release(key); + } else if (!this._touchPressed && + event.type() == Clutter.EventType.TOUCH_END && + device.sequence_get_grabbed_actor(sequence) == null) { + // This is required in order to activate an extended key + // in case the user keeps the finger over the screen. + this._press(key); + this._release(key); } return Clutter.EVENT_PROPAGATE; });