mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-30 01:16:43 -06:00
18 lines
447 B
TypeScript
18 lines
447 B
TypeScript
export default (input: string): string[] => {
|
|
if (Object.keys(aliases).some(a => a.toLowerCase() === input.toLowerCase())) {
|
|
const codes = aliases[input];
|
|
return Array.isArray(codes) ? codes : [codes];
|
|
} else {
|
|
return [input];
|
|
}
|
|
};
|
|
|
|
export const aliases = {
|
|
'esc': 'Escape',
|
|
'enter': ['Enter', 'NumpadEnter'],
|
|
'up': 'ArrowUp',
|
|
'down': 'ArrowDown',
|
|
'left': 'ArrowLeft',
|
|
'right': 'ArrowRight',
|
|
'plus': ['NumpadAdd', 'Semicolon'],
|
|
};
|