1

Using a Belkin KVM switch. Normally, I'd be able to double-tap scroll-lock and choose a number corresponding to the machine I wish to switch to, however, since I upgraded from 12.10 to 13.04 Beta 2, double-tapping the scroll-lock no longer changes machines.

I had assumed that this "double-tap" was hardcoded into the KVM unit and it should always work, but it seems I was wrong.

Anybody have any ideas? The KVM is a Belkin 2-port 1DL102P (with built-in cables and audio support), and doesn't have any buttons on the unit itself, so there's no "manual override" or "hard reset" buttons.

Looks like this:

Belkin 2-port 1DL102P

Any thoughts, ideas, or suggestions? Is it some kind of key-binding glitch?

3 Answers 3

1

Does it switch when you call this script?

#!/bin/bash
SLEEP=0.2
LEDMASK=4
LEDNAME="Scroll Lock"

xmessage -timeout 1 "Switching..." &

STATE="$(( $(xset q | awk '/LED/ {print $10}') & LEDMASK ))"

test $STATE -eq $LEDMASK && xset -led named "$LEDNAME" && sleep $SLEEP
xset led named "$LEDNAME"  
sleep $SLEEP
xset -led named "$LEDNAME" 
sleep $SLEEP
xset led named "$LEDNAME"  
test $STATE -ne $LEDMASK && sleep $SLEEP && xset -led named "$LEDNAME"
2
  • I stopped using the device after a week. It was just a temporary solution while I was testing a server tower I didn't have spares for. Nov 9, 2014 at 0:17
  • Scroll lock on the keyboard does not work for me, but this script does. Any hint why?
    – Alex
    Mar 23, 2015 at 1:37
0

OK, it seems that unplugging the KVM's kbd/mouse adapters from both machines and plugging it back in served as a "hard reset" of sorts because now it's working again.

Since this unit derives it's power from the PS2 ports instead of using an AC Adapter, unplugging the PS2 cables did the trick.

0

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.)

Apple keyboard and alternative keycap showing both "Scroll Lock" and 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"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .