emit mapped keys from input-component

This commit is contained in:
Shin'ya Ueoka 2017-10-21 11:06:58 +09:00
parent c2a663a64d
commit 214a5103f3
6 changed files with 95 additions and 21 deletions

View file

@ -1,16 +1,9 @@
import actions from 'content/actions';
const asKeymapChars = (key, ctrl) => {
if (ctrl) {
return '<C-' + key.toUpperCase() + '>';
}
return key;
};
const keyPress = (key, ctrl) => {
const keyPress = (key) => {
return {
type: actions.INPUT_KEY_PRESS,
key: asKeymapChars(key, ctrl),
key,
};
};