BackgroundInputComponent
This commit is contained in:
parent
825bb63476
commit
a74a8b537e
4 changed files with 60 additions and 51 deletions
21
src/shared/keys.js
Normal file
21
src/shared/keys.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
const asKeymapChars = (keys) => {
|
||||
return keys.map((k) => {
|
||||
let c = String.fromCharCode(k.code);
|
||||
if (k.ctrl) {
|
||||
return '<C-' + c.toUpperCase() + '>';
|
||||
}
|
||||
return c;
|
||||
}).join('');
|
||||
};
|
||||
|
||||
const asCaretChars = (keys) => {
|
||||
return keys.map((k) => {
|
||||
let c = String.fromCharCode(k.code);
|
||||
if (k.ctrl) {
|
||||
return '^' + c.toUpperCase();
|
||||
}
|
||||
return c;
|
||||
}).join('');
|
||||
};
|
||||
|
||||
export { asKeymapChars, asCaretChars };
|
Reference in a new issue