emit mapped keys from input-component
This commit is contained in:
parent
c2a663a64d
commit
214a5103f3
6 changed files with 95 additions and 21 deletions
|
@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue