| @@ -67,8 +67,9 @@ | ||
| 67 | 67 | displayShortcut: () => displayShortcut, |
| 68 | 68 | displayShortcutList: () => displayShortcutList, |
| 69 | 69 | isAppleOS: () => isAppleOS, |
| 70 | 70 | isKeyboardEvent: () => isKeyboardEvent, |
| 71 | + keyboardShortcut: () => keyboardShortcut, | |
| 71 | 72 | modifiers: () => modifiers, |
| 72 | 73 | rawShortcut: () => rawShortcut, |
| 73 | 74 | shortcutAriaLabel: () => shortcutAriaLabel, |
| 74 | 75 | withIgnoreIMEEvents: () => withIgnoreIMEEvents |
| @@ -217,8 +218,26 @@ | ||
| 217 | 218 | (key) => capitaliseFirstCharacter(replacementKeyMap[key] ?? key) |
| 218 | 219 | ).join(isApple ? " " : " + "); |
| 219 | 220 | }; |
| 220 | 221 | }); |
| 222 | + var keyboardShortcut = /* @__PURE__ */ Object.fromEntries( | |
| 223 | + Object.keys(modifiers).map( | |
| 224 | + (modifier) => [ | |
| 225 | + modifier, | |
| 226 | + (character, _isApple = isAppleOS) => ({ | |
| 227 | + displayShortcut: displayShortcut[modifier]( | |
| 228 | + character, | |
| 229 | + _isApple | |
| 230 | + ), | |
| 231 | + ariaKeyShortcut: ariaKeyShortcut[modifier]( | |
| 232 | + character, | |
| 233 | + _isApple | |
| 234 | + ), | |
| 235 | + label: shortcutAriaLabel[modifier](character, _isApple) | |
| 236 | + }) | |
| 237 | + ] | |
| 238 | + ) | |
| 239 | + ); | |
| 221 | 240 | function getEventModifiers(event) { |
| 222 | 241 | return [ALT, CTRL, COMMAND, SHIFT].filter( |
| 223 | 242 | (key) => event[`${key}Key`] |
| 224 | 243 | ); |