aboutsummaryrefslogtreecommitdiff
path: root/src/content/actions/input.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/actions/input.js')
-rw-r--r--src/content/actions/input.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/content/actions/input.js b/src/content/actions/input.js
new file mode 100644
index 0000000..cc4efac
--- /dev/null
+++ b/src/content/actions/input.js
@@ -0,0 +1,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 };