Add key event to omnibox in chrome extension

Is it possible to somehow listen to key events ( keyup, keydown, keypress ) in chrome omnibox ?

So far, I just found:

 chrome.omnibox.onInputStarted.addListener(function() {...}); chrome.omnibox.onInputChanged.addListener(function(string text, function suggest) {...}); chrome.omnibox.onInputEntered.addListener(function(string text) {...}); chrome.omnibox.onInputCancelled.addListener(function() {...}); 

Edit:

The problem with the onInputChanged event is that it does not fire when the user uses the arrow keys to jump to one of the sentences.

+6
source share
1 answer

I did not look at the source, however there is an example here: http://developer.chrome.com/extensions/samples.html#be68e4d262d74d2457999fc402f5bf5e

I just tried (type "omnix s" in omnibox) and can tell you what than using the arrow keys to go to one of the suggestions that a warning is displayed, telling me about the selected option.

Note. This only works if the selected option displays an extension icon next to it.

+3
source

All Articles