From c10eaa17861a305be765dc831c773ca7b2b46224 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Thu, 27 May 2021 00:05:50 +0100 Subject: [PATCH] Add BAPS2 keyboard Fkeys (will only work in Neutron Studio) --- src/mixer/state.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/mixer/state.ts b/src/mixer/state.ts index a624458..a118905 100644 --- a/src/mixer/state.ts +++ b/src/mixer/state.ts @@ -545,6 +545,35 @@ export const mixerKeyboardShortcutsMiddleware: Middleware< RootState, Dispatch > = (store) => { + // The F keys will only work in places like Electron (NeutronStudio) where they don't trigger browser functions. + Keys("f1", () => { + sendBAPSicleChannel({ channel: 0, command: "PLAY" }); + }); + Keys("f2", () => { + sendBAPSicleChannel({ channel: 0, command: "PAUSE" }); + }); + Keys("f3", () => { + sendBAPSicleChannel({ channel: 0, command: "STOP" }); + }); + Keys("f5", () => { + sendBAPSicleChannel({ channel: 1, command: "PLAY" }); + }); + Keys("f6", () => { + sendBAPSicleChannel({ channel: 1, command: "PAUSE" }); + }); + Keys("f7", () => { + sendBAPSicleChannel({ channel: 1, command: "STOP" }); + }); + Keys("f9", () => { + sendBAPSicleChannel({ channel: 2, command: "PLAY" }); + }); + Keys("f10", () => { + sendBAPSicleChannel({ channel: 2, command: "PAUSE" }); + }); + Keys("f11", () => { + sendBAPSicleChannel({ channel: 2, command: "STOP" }); + }); + Keys("q", () => { sendBAPSicleChannel({ channel: 0, command: "PLAY" }); });