function resolveHotkeyAlternates<T>(hotkey, platform?): PlatformHotkeyEntries<NonNullable<T>>[];Defined in: alternates.ts:62
Resolves the hotkeys of a hotkey object for one platform that come after the one labels show: resolveHotkeys without its first hotkey. A hotkey without alternates returns an empty array.
Call this to list the alternates next to a label, such as in a cheat sheet. Where the platform has only alternates, the first of them is the label, so it is not in this list.
T
T
A hotkey object, or any other hotkey
HotkeyPlatform = ...
The target platform. Defaults to auto-detection.
PlatformHotkeyEntries<NonNullable<T>>[]
const redo = {
default: 'Mod+Y',
mac: 'Mod+Shift+Z',
alternates: [{ default: 'Mod+Shift+Z', mac: null }],
} as const
resolveHotkeyAlternates(redo, 'windows') // ['Mod+Shift+Z']
resolveHotkeyAlternates(redo, 'mac') // []
resolveHotkeyAlternates({ default: null, alternates: ['F1', 'F2'] }, 'mac') // ['F2']