Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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: 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! –  Ben Richards Aug 30 '11 at 17:53
add comment

Your Answer

 
discard

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.