Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; If your plugins grab keyboard, this is it.
- ; This script bypasses space bar presses from Bitwig's plugin host windows
- ; to Bitwig's main window. The behavior can be enabled and disabled by
- ; pressing Control-Win-Alt-Space key combination.
- ; Sending modifier keypresses to Bitwig doesn't seem to work. This is either
- ; a Windows, Bitwig or AHK issue.
- ; Last updated: October the 27th 2025, 7AM UT1
- ; - Now works with BwS6
- ; - Cleaned up a bit
- #Requires AutoHotkey >2.0
- #SingleInstance Force
- A_MenuMaskKey := ""
- A_ScriptName := "von Elsewhere's Space Pass"
- SetTitleMatchMode("RegEx")
- OnExit exitFunc
- InfoTip(msg) {
- TrayTip(msg, A_ScriptName, 1)
- SetTimer((*) => TrayTip(), -1500)
- }
- InfoTip("Script running")
- ; Isolate to Bitwig's plugin windows
- GroupAdd("BitwigPluginHost", "ahk_class vst3window ahk_exe BitwigPluginHost-X64-AVX2\.exe") ; BwS6
- GroupAdd("BitwigPluginHost", "ahk_class vst3window ahk_exe BitwigPluginHost-X86-AVX2\.exe") ; BwS6
- GroupAdd("BitwigPluginHost", "ahk_class vst3window ahk_exe BitwigPluginHost-X64-SSE41\.exe") ; BwS5
- GroupAdd("BitwigPluginHost", "ahk_class vst3window ahk_exe BitwigPluginHost-X86-SSE41\.exe") ; BwS5
- #HotIf WinActive("ahk_group BitwigPluginHost")
- ; Turn off and on the space bypass with Ctrl-Win-Alt-Space
- ^#!Space:: {
- InfoTip("Plugin space bypass " . (spacer("flip") ? "enabled" : "disabled"))
- }
- *Space:: {
- if spacer() {
- return
- }
- Send("{blind}{Space}")
- }
- ~*Space up:: {
- }
- #HotIf
- ; SOME FUNCTIONS
- spacer(cmd := "send") {
- static spacePassEnabled := 1
- static modifierKeysList := ["Shift", "Control", "Alt"]
- if cmd == "flip" {
- spacePassEnabled := !spacePassEnabled
- return spacePassEnabled
- }
- if !(spacePassEnabled) {
- return 0
- }
- if (A_ThisHotkey == A_PriorHotkey) {
- return 1
- }
- if (BW_HWND := WinExist("^Bitwig\sStudio.* ahk_class bitwig ahk_exe BitwigStudioApp\.exe")) {
- for i, v in modifierKeysList { ; Sending modifiers unfortunately doesn't seem to work, sorry
- if (GetKeyState(v), "P") {
- ControlSend("{" . v . " down}", BW_HWND)
- }
- }
- ControlSend("{Blind}{Space}", BW_HWND)
- for i, v in modifierKeysList {
- if (GetKeyState(v)) {
- ControlSend("{" . v . " up}", BW_HWND)
- }
- }
- return 1
- }
- return 0
- }
- exitFunc(*) {
- InfoTip("Script stopping")
- }
Advertisement
Add Comment
Please, Sign In to add comment