I am using BMTP v1.9.0 on MacBook Pro (Retina, 15-inch, Mid 2015) running Monterey 12.4.
I am experiencing a problem with command key when I switch from one app to another using the shortcut cmd+tab.
Example step by step:
I configure the shortcut F10 in BMTP to send note on 50 to Cubase
I configure the shortcut cmd+F10 in BMTP to send note on 60 to Cubase
the foreground app is Finder
I press command key, holding it
I press tab once
the application switcher appears, and it selects the next opened app, Script Editor
I press tab once again
the application switcher selects the next opened app, Cubase
I release the command key
Cubase 12 is now the foreground app
I hit the key F10, configured in BMTP to send midi note 50, but BMTP sends the midi note 60 (as if I had pressed the shortcut cmd+F10)
So the problem is that when I am switching apps with cmd+tab, and I release cmd key, BMTP doesn’t “hear” that I released cmd key, and BMTP understands that cmd key is still pressed.
If I press cmd key alone again, and I release it, the problem is solved.
I have found a workaround using a Timer that sends an outgoing action of command key down and up when any application changes to foreground. The timer needs a delay of minimum 250 miliseconds in the outgoing action to do the command key down & up.
This solution seems to work, but I would prefer that BMTP always hear my command key.
Maybe it’s not a bug, but I have tried a lot of things and the issue persists.
The last thing I have done is to set a variable for each modifier key in BMTP, and run an applescript to get the values of that variables and log all them. Everytime I change of app using cmd+tab, I run the applescript*, and it always log the variable of command key with a value of 1(pressed) instead of 0(released). *I run the applescript with mouse click, not pressing any modifier key.
Another interesting issue is that I have configured the following shortcut in system preferences/keyboard to move between windows of all opened apps:
ctrl+alt+tab → set the focus to the next window or the next active window
If I hit ctrl+alt+tab and I switch from app to app, there is no problem when I release control and alt keys, BMTP always “hear” that releases.