aboutsummaryrefslogtreecommitdiff
path: root/src/content/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/components')
-rw-r--r--src/content/components/common/input.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/content/components/common/input.js b/src/content/components/common/input.js
index 9af9fbe..f285b0c 100644
--- a/src/content/components/common/input.js
+++ b/src/content/components/common/input.js
@@ -1,6 +1,17 @@
+const modifierdKeyName = (name) => {
+ if (name.length === 1) {
+ return name.toUpperCase();
+ } else if (name === 'Escape') {
+ return 'Esc';
+ }
+ return name;
+};
+
const mapKey = (e) => {
if (e.ctrlKey) {
- return '<C-' + e.key.toUpperCase() + '>';
+ return '<C-' + modifierdKeyName(e.key) + '>';
+ } else if (e.shiftKey && e.key.length !== 1) {
+ return '<S-' + modifierdKeyName(e.key) + '>';
}
return e.key;
};