diff options
| author | Li Fang | 2018-08-10 23:04:16 +0800 |
|---|---|---|
| committer | GitHub | 2018-08-10 23:04:16 +0800 |
| commit | 3134c397979b364a3def159757ec88c9e36cfaea (patch) | |
| tree | fd78078473a90c8d0a7df9401548f0a9d5255f09 | |
| parent | 342723bbef945492fbbe80069edd04f0fb2ca67e (diff) | |
| download | vimium-3134c397979b364a3def159757ec88c9e36cfaea.tar.bz2 | |
Fixed #3068
Fixed frustrating IME leftover issue when press ESC in input
| -rw-r--r-- | lib/keyboard_utils.coffee | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/keyboard_utils.coffee b/lib/keyboard_utils.coffee index 673289b9..63d2afdc 100644 --- a/lib/keyboard_utils.coffee +++ b/lib/keyboard_utils.coffee @@ -66,7 +66,10 @@ KeyboardUtils = (event) -> # <c-[> is mapped to Escape in Vim by default. - event.key == "Escape" or (useVimLikeEscape and @getKeyCharString(event) == "<c-[>") + # Escape with a keyCode 229 means that this event comes from IME, and should not be treat as a directly/normal ESC press. + # In this case, IME will take care of the ESC press event, not vimium. + # See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html + (event.key == "Escape" and event.keyCode != 229) or (useVimLikeEscape and @getKeyCharString(event) == "<c-[>") isBackspace: (event) -> event.key in ["Backspace", "Delete"] |
