Fix input method editor is processing key input issue. #72

pull/73/head
jaywcjlove 6 years ago
parent 1b7ddb5a2d
commit 3bbefc82d4

@ -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键值不一样

Loading…
Cancel
Save