Работа над хоткеями
This commit is contained in:
@@ -202,4 +202,20 @@ export function escapeXml(str) {
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
;
|
||||
}
|
||||
|
||||
export function keyEventToCode(event) {
|
||||
let result = [];
|
||||
if (event.metaKey)
|
||||
result.push('Meta');
|
||||
if (event.ctrlKey)
|
||||
result.push('Ctrl');
|
||||
if (event.shiftKey)
|
||||
result.push('Shift');
|
||||
if (event.altKey)
|
||||
result.push('Alt');
|
||||
|
||||
result.push(event.code);
|
||||
|
||||
return result.join('+');
|
||||
}
|
||||
Reference in New Issue
Block a user