Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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

share|improve this answer
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. – Ben Richards Aug 30 '11 at 0:17
Neither of those keybindings worked, so I used the method described in the FAQ here to find it: I had to use the first form that you listed, but substitute <Scroll_Lock> with <key-20>. But now it is properly ignored! Thanks! – Ben Richards Aug 30 '11 at 17:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.