Is it somehow possible to listen to keyevents (keyup, keydown, keypress
) in the 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 doesn't fire, when the user uses the arrow keys to navigate to one of the suggestions.
I haven't looked at the source, however, there's an example over here: http://developer.chrome.com/extensions/samples.html#be68e4d262d74d2457999fc402f5bf5e
I just tried it (type "omnix s" into the omnibox), and can report than when using the arrow keys to navigate to one of the suggestions that an alert is displayed, informing me of the selected option.
Note: This only works if the selected option displays the extension's icon next to it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With