Bug 1057338 - Update keyboard event ignoring code

use heuristics from mousetrap library (https://github.com/ccampbell/mousetrap):
* Also ignore keyboard events if in other types of input elements
* Ignore keyboard events if element's content is editable
Merge pull request #138 from wlach/1057338

Even better heuristics for key event ignoring