aboutsummaryrefslogtreecommitdiff
path: root/src/content/actions/input.js
blob: cc4efacfa087d8c1cdf450fb57196025f0b2f782 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import actions from 'content/actions';

const asKeymapChars = (key, ctrl) => {
  if (ctrl) {
    return '<C-' + key.toUpperCase() + '>';
  }
  return key;
};

const keyPress = (key, ctrl) => {
  return {
    type: actions.INPUT_KEY_PRESS,
    key: asKeymapChars(key, ctrl),
  };
};

const clearKeys = () => {
  return {
    type: actions.INPUT_CLEAR_KEYS
  };
};

export { keyPress, clearKeys };