mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-02 05:40:52 -07:00
feat(overlay): forward mpv mouse button and wheel bindings (#279)
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
createMpvKeybindingRows,
|
||||
keyboardEventToConfigKey,
|
||||
mouseEventToConfigKey,
|
||||
wheelEventToConfigKey,
|
||||
} from './key-input';
|
||||
|
||||
test('keyboardEventToConfigKey formats Electron accelerators from learned input', () => {
|
||||
@@ -93,6 +94,21 @@ test('mouseEventToConfigKey formats mpv mouse buttons from learned input', () =>
|
||||
);
|
||||
});
|
||||
|
||||
test('wheelEventToConfigKey formats mpv wheel keys only for mpv keybindings', () => {
|
||||
const wheel = {
|
||||
deltaX: 0,
|
||||
deltaY: -120,
|
||||
deltaMode: 0,
|
||||
ctrlKey: true,
|
||||
altKey: false,
|
||||
shiftKey: false,
|
||||
metaKey: false,
|
||||
};
|
||||
assert.equal(wheelEventToConfigKey(wheel, 'dom-code'), 'Ctrl+WHEEL_UP');
|
||||
assert.equal(wheelEventToConfigKey({ ...wheel, deltaY: 0 }, 'dom-code'), null);
|
||||
assert.equal(wheelEventToConfigKey(wheel, 'accelerator'), null);
|
||||
});
|
||||
|
||||
test('MPV keybinding rows save default key moves as a disable plus replacement', () => {
|
||||
const defaults: Keybinding[] = [{ key: 'Space', command: ['cycle', 'pause'] }];
|
||||
const rows = createMpvKeybindingRows(defaults, []);
|
||||
|
||||
Reference in New Issue
Block a user