diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 386150fd3..011855fb5 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -279,8 +279,7 @@ const ViewSelector = new Lang.Class({ else Main.overview.hide(); return true; - } else if (Clutter.keysym_to_unicode(symbol) || - (symbol == Clutter.BackSpace && this._searchActive)) { + } else if (this._shouldTriggerSearch(symbol)) { this.startSearch(event); } else if (!this._searchActive) { if (symbol == Clutter.Tab || symbol == Clutter.Down) { @@ -345,6 +344,17 @@ const ViewSelector = new Lang.Class({ } }, + _shouldTriggerSearch: function(symbol) { + let unicode = Clutter.keysym_to_unicode(symbol); + if (unicode == 0) + return false; + + if (getTermsForSearchString(String.fromCharCode(unicode)).length > 0) + return true; + + return symbol == Clutter.BackSpace && this._searchActive; + }, + startSearch: function(event) { global.stage.set_key_focus(this._text); this._text.event(event, true);