mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 13:18:27 +02:00
6.0
This commit is contained in:
59
src/modules/shortcuts/shortcut-actions.ts
Executable file
59
src/modules/shortcuts/shortcut-actions.ts
Executable file
@@ -0,0 +1,59 @@
|
||||
import { PrefKey } from "@/enums/pref-keys";
|
||||
import { ShortcutAction } from "@/enums/shortcut-actions";
|
||||
import { AppInterface, STATES } from "@/utils/global";
|
||||
import { getPref } from "@/utils/settings-storages/global-settings-storage";
|
||||
import { t } from "@/utils/translation";
|
||||
|
||||
type ShortcutActions = {
|
||||
[key: string]: {
|
||||
[key in ShortcutAction]?: string[];
|
||||
};
|
||||
};
|
||||
|
||||
export const SHORTCUT_ACTIONS: ShortcutActions = {
|
||||
// Script
|
||||
[t('better-xcloud')]: {
|
||||
[ShortcutAction.BETTER_XCLOUD_SETTINGS_SHOW]: [t('settings'), t('show')],
|
||||
},
|
||||
|
||||
// Device
|
||||
...(!!AppInterface ? {
|
||||
[t('device')]: {
|
||||
[ShortcutAction.DEVICE_SOUND_TOGGLE]: [t('sound'), t('toggle')],
|
||||
[ShortcutAction.DEVICE_VOLUME_INC]: [t('volume'), t('increase')],
|
||||
[ShortcutAction.DEVICE_VOLUME_DEC]: [t('volume'), t('decrease')],
|
||||
|
||||
[ShortcutAction.DEVICE_BRIGHTNESS_INC]: [t('brightness'), t('increase')],
|
||||
[ShortcutAction.DEVICE_BRIGHTNESS_DEC]: [t('brightness'), t('decrease')],
|
||||
},
|
||||
} : {}),
|
||||
|
||||
// Stream
|
||||
[t('stream')]: {
|
||||
[ShortcutAction.STREAM_SCREENSHOT_CAPTURE]: [t('take-screenshot')],
|
||||
[ShortcutAction.STREAM_VIDEO_TOGGLE]: [t('video'), t('toggle')],
|
||||
|
||||
[ShortcutAction.STREAM_SOUND_TOGGLE]: [t('sound'), t('toggle')],
|
||||
|
||||
...(getPref(PrefKey.AUDIO_VOLUME_CONTROL_ENABLED) ? {
|
||||
[ShortcutAction.STREAM_VOLUME_INC]: [t('volume'), t('increase')],
|
||||
[ShortcutAction.STREAM_VOLUME_DEC]: [t('volume'), t('decrease')],
|
||||
} : {}),
|
||||
|
||||
[ShortcutAction.STREAM_MENU_SHOW]: [t('menu'), t('show')],
|
||||
[ShortcutAction.STREAM_STATS_TOGGLE]: [t('stats'), t('show-hide')],
|
||||
[ShortcutAction.STREAM_MICROPHONE_TOGGLE]: [t('microphone'), t('toggle')],
|
||||
},
|
||||
|
||||
// MKB
|
||||
...(STATES.browser.capabilities.mkb ? {
|
||||
[t('mouse-and-keyboard')]: {
|
||||
[ShortcutAction.MKB_TOGGLE]: [t('toggle')],
|
||||
},
|
||||
} : {}),
|
||||
|
||||
// Other
|
||||
[t('other')]: {
|
||||
[ShortcutAction.TRUE_ACHIEVEMENTS_OPEN]: [t('true-achievements'), t('show')],
|
||||
},
|
||||
} as const;
|
Reference in New Issue
Block a user