2023-07-27 05:31:52 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2018-09-18 03:34:41 +00:00
|
|
|
export default (input: string): string[] => {
|
2020-04-03 23:46:54 +00:00
|
|
|
if (Object.keys(aliases).some(a => a.toLowerCase() === input.toLowerCase())) {
|
2018-09-18 03:34:41 +00:00
|
|
|
const codes = aliases[input];
|
|
|
|
return Array.isArray(codes) ? codes : [codes];
|
|
|
|
} else {
|
|
|
|
return [input];
|
2018-09-17 20:35:06 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export const aliases = {
|
2018-09-18 03:34:41 +00:00
|
|
|
'esc': 'Escape',
|
|
|
|
'enter': ['Enter', 'NumpadEnter'],
|
|
|
|
'up': 'ArrowUp',
|
|
|
|
'down': 'ArrowDown',
|
|
|
|
'left': 'ArrowLeft',
|
|
|
|
'right': 'ArrowRight',
|
|
|
|
'plus': ['NumpadAdd', 'Semicolon'],
|
2018-09-17 20:35:06 +00:00
|
|
|
};
|