Stuck modifier keys in Screens app

I'm using the Screens app by Edovia for screen sharing with another Mac on the same local network. I can't get shortcuts with modifier keys to work. For example, I want to set a trackpad gesture to send command-h. With both "shortcut sending compatibility mode" on and "always use old keyboard shortcut implementation" on, the shortcut works (the app on the other computer is hidden), but the command key gets stuck down on the other computer. The "send key down and up" setting makes no difference. Sending a "CMD Key Up" action doesn't help. With the compatibility mode or old implementation off, I only get 'h', not command-h. Sending individual command-down, h, command-up doesn't work either.

I've tried every combination of modes, but I can't get modifier-key shortcut actions, either from a trackpad gesture or keyboard command, to work correctly.

Device information:

  • Type of Mac: Mac mini M1
  • macOS version: 11.4
  • BetterTouchTool version: 3.570

unfortunately most screen sharing or virtual desktop software doesn’t implement the macOS modifier event API correctly. In have never found a way to make this work ;-(

It works in Apple's Screen Sharing app, but that has various other problems. I tried a few different screen-sharing apps, and none of them seem to work well with BTT, as you said. Oh well, thanks anyway.

Could there could be an action to send things over a network connection, something like BTT Remote does? Maybe I'll try triggering a script to send MIDI to the other computer, and use BTT there to change it back into a shortcut.

Tip: You can do it yourself with Applescript:

tell application "BetterTouchTool" of machine machine "eppc://username:passsword@Target-Mac.local" -- or @IPaddress
    trigger_named "SampleNamedTrigger"
end tell

You need to enable Remote Apple Events in System Preferences > Sharing of the target Mac. There you will also find its correct name in the network.

@Andreas_Hegenberg I worked around it with MIDI. It would be nice if BTT had a built-in action to send MIDI messages. It would be even nicer if BTT had its own network tunnel to another instance of BTT... But this works quite well for me:

  • set up a Network MIDI session between the two computers with Audio Midi Setup, and name it, e.g. "My MIDI Session" (see Share MIDI information over a network in Audio MIDI Setup on Mac - Apple Support)
  • install "sendmidi": GitHub - gbevin/SendMIDI: Multi-platform command-line tool to send out MIDI messages into /usr/local/bin on the controlling (local) computer. If it won't run and gives you a message about not being able to check for malware, you may need to remove the Apple quarantine flag with xattr -d com.apple.quarantine /usr/local/bin/sendmidi
  • in BTT assign action "Execute Shell Script/Task" to your gesture, shortcut, etc.
  • put in a script like:
    /usr/local/bin/sendmidi device "Network My MIDI Session" pc 1
    • this will send MIDI Program Change 1 to the network MIDI session named "My MIDI Session". Be sure to add the word "Network" to the beginning of the name.
    • for additional gestures/commands, use pc 2, pc 3, etc. You can use other messages if you prefer.
  • on the receiving (remote) computer, in BTT add a MIDI Trigger, Program Change, number 1, for device with name "Network My MIDI Session", and assign whatever action you want.

@Dirk thanks for the suggestion about Remote Apple Events, that could work too. But I didn't like the idea of putting my password in the script, and enabling Remote Apple Events, which are very powerful. From a security perspective, that opens up potential exposure that the MIDI solution doesn't have.