diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-03 20:58:50 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-03 20:58:50 +0900 |
commit | 5ac1f60ece0a112a55f329ed34b455dcc776b22c (patch) | |
tree | 1c901a6529fd50b9e62d50a2131c3043ccfb5079 /src/actions | |
parent | eff8d9a83edf63bab09df4bd7f6e20e85fba3899 (diff) |
remove deprecated property in KeyboardEvent
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/input.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/actions/input.js b/src/actions/input.js index 07948a1..67788dd 100644 --- a/src/actions/input.js +++ b/src/actions/input.js @@ -1,10 +1,16 @@ import actions from '../actions'; -const keyPress = (code, ctrl) => { +const asKeymapChars = (key, ctrl) => { + if (ctrl) { + return '<C-' + key.toUpperCase() + '>'; + } + return key; +}; + +const keyPress = (key, ctrl) => { return { type: actions.INPUT_KEY_PRESS, - code, - ctrl + key: asKeymapChars(key, ctrl), }; }; |