(e, useCode=false)
| 33 | } |
| 34 | |
| 35 | export function parseKeyEventValue(e, useCode=false) { |
| 36 | let shortcut = ''; |
| 37 | if(!e) { |
| 38 | return null; |
| 39 | } |
| 40 | if (e.altKey) { shortcut += 'alt+'; } |
| 41 | if (e.shiftKey) { shortcut += 'shift+'; } |
| 42 | if (isMac() && e.metaKey) { shortcut += 'meta+'; } |
| 43 | else if (e.ctrlKey) { shortcut += 'ctrl+'; } |
| 44 | shortcut += useCode? getCode(e) : e.key.toLowerCase(); |
| 45 | return shortcut; |
| 46 | } |
| 47 | |
| 48 | export function isShortcutValue(obj) { |
| 49 | if(!obj) return false; |
no test coverage detected