Skip to content

Commit

Permalink
Fix input method editor is processing key input issue. #72
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 7, 2019
1 parent 1b7ddb5 commit 3bbefc8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,11 @@ function dispatch(event) {
const asterisk = _handlers['*'];
let key = event.keyCode || event.which || event.charCode;

// 搜集绑定的键
if (_downKeys.indexOf(key) === -1) _downKeys.push(key);
// Collect bound keys
// If an Input Method Editor is processing key input and the event is keydown, return 229.
// https://stackoverflow.com/questions/25043934/is-it-ok-to-ignore-keydown-events-with-keycode-229
// http://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html
if (_downKeys.indexOf(key) === -1 && key !== 229) _downKeys.push(key);

// Gecko(Firefox)的command键值224,在Webkit(Chrome)中保持一致
// Webkit左右command键值不一样
Expand Down

0 comments on commit 3bbefc8

Please sign in to comment.