2

I am using a Linux machine with a KVM switch at work, and I commonly use emacs while switching between that machine and my other machine. I typically use the keyboard shortcut to swap between machines on the KVM, which is the key sequence: Scroll Lock, Scroll Lock, Up or Down. If I have an emacs window on top on Linux and hit these buttons, it will trap the Scroll Lock key presses and trigger a system beep from the CPU speaker. The KVM still switches, but on occasion, after the switch, it will register Scroll Lock as being stuck pressed, and so I'll be treated to an earful of system beeping. I have to switch back to the computer to get it to stop.

Is there something I can put in the .emacs file that will prevent the program from beeping when I hit Scroll Lock with the window on top?

1 Answer 1

4

This looks like what you're looking for here

either this

(global-set-key (kbd "<Scroll_Lock>") 'ignore)

or this

(global-set-key [scroll-lock] 'ignore)

Depending on the version of emacs

2
  • Wow, I tried doing a web search but came up dry. That's incredibly specific to my situation. Thanks! I'll try it at work tomorrow and see if it works. Commented Aug 30, 2011 at 0:17
  • Neither of those keybindings worked, so I used the method described in the FAQ here to find it: xahlee.org/emacs/keyboard_shortcuts.html. I had to use the first form that you listed, but substitute <Scroll_Lock> with <key-20>. But now it is properly ignored! Thanks! Commented Aug 30, 2011 at 17:53

You must log in to answer this question.

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