import { registerAndGetData } from '@/plugins/data' export const presetBase: Record = { fullscreen: 'f', webFullscreen: 'w', wideScreen: 't', volumeUp: 'arrowUp', volumeDown: 'arrowDown', mute: 'm', pictureInPicture: 'p', coin: 'c', favorite: 's', pause: 'space', like: 'l', playerMenu: '`', longJumpForward: 'j', longJumpBackward: 'shift j', jumpBackward: 'arrowLeft', jumpForward: 'arrowRight', previousPart: '[', nextPart: ']', focusDanmakuInput: 'enter', danmaku: 'd', seekBegin: 'digit0', // 1-9 跳转到对应百分比 ...lodash.fromPairs(lodash.range(1, 10).map(i => [`seekProgress${i}0`, `digit${i}`])), sendComment: 'ctrl enter', } export const builtInPresets: Record> = { Default: {}, Bilibili: { webFullscreen: '', like: 'q', coin: 'w', favorite: 'e', jumpBackward: 'arrowLeft', jumpForward: 'arrowRight', previousPart: '[', nextPart: ']', focusDanmakuInput: 'enter', }, YouTube: { like: '', pause: 'space k', longJumpForward: 'l', longJumpBackward: 'j', seekBegin: 'digit0 Home', // 1-9 跳转到对应百分比 ...lodash.fromPairs(lodash.range(1, 10).map(i => [`seekProgress${i}0`, `digit${i}`])), }, HTML5Player: { coin: 'shift c', danmaku: 'shift d', fullscreen: 'enter', webFullscreen: 'shift enter', pictureInPicture: 'shift p', longJumpBackward: 'ctrl arrowLeft', longJumpForward: 'ctrl arrowRight', }, PotPlayer: { coin: 'shift c', danmaku: 'shift d', fullscreen: 'enter', webFullscreen: 'digit6', longJumpBackward: 'ctrl arrowLeft', longJumpForward: 'ctrl arrowRight', seekBegin: 'backspace', }, } export const [, presets] = registerAndGetData('keymap.presets', presetBase, builtInPresets)