uli42's answer held the key when it worked on my Syba KVM. The KVM isn't listening for the "key pressed" signal from the keyboard to the PC, but for the "set LED" signal from the PC to the keyboard... probably so it can piggy back on the OS's support for all sorts of different keyboard layouts and Just Work™ if the power user who bought the KVM has customized their keymap.
Heck, the manual of my Syba KVM says that feature "only works on Windows" which, in hindsight, was a huge clue.
(macOS has no concept of Scroll Lock and wouldn't toggle the LED, while X11's default keyboard config has left Scroll Lock unbound for ages.)
Re-adding the binding with something like
xmodmap -e 'add mod3 = Scroll_Lock'
will make it work under X11 like on Windows.
(I don't have time to test it, but I imagine that you could also make the same muscle memory work on any mac by writing a script of some kind to toggle the scroll lock LED and then binding it to F14.)
As for Wayland, ask the developers of your specific DE. Last I looked into it, the author of libinput had been leaving it up to each Wayland compositor to develop their own solutions equivalent to the xmodmap
, setxkbmap
, etc. commands.
Alternatively, you could make it a single keypress by leaving mod3
unbound and using something like xbindkeys
to run a script like this on Scroll_Lock
keypress.
#!/bin/sh
LEDNAME="Scroll Lock"
echo "Switching KVM..."
xset led named "$LEDNAME"
sleep 0.5
xset -led named "$LEDNAME"