My keyboard has an incredibly dumbly placed "sleep mode" key that I occasionally accidentally hit.
Is there any way that I could disable that one key?
My keyboard has an incredibly dumbly placed "sleep mode" key that I occasionally accidentally hit.
Is there any way that I could disable that one key?
Quad Core Q6600 3GB RAM 300GB Hard DriveS nVidia GeForce 8400
Current Ubuntu Problems (2) PLEASE HELP!!:[NOT solved]Disappearing Firefox windows | [NOT SOLVED]AR5413 Atheros Card, NO linux support?
Current Vista Problems (1): It fails to boot
Is it a desktop machine? If so and, you never use the "sleep" mode, you could probably disable it by hitting Alt-F2 and typing gconf-editor. Then navigate to /apps/gnome-power-manager/general and uncheck can_suspend and can_hibernate.
Don't try to make something "fast" until you are able to quantify "slow".
This works for symbols. Since it is merely sending a signal, I would expect it to work for this situation as well.
Run the following command to find the keycode value of the desired key:
With the small box in foreground, press the sleep key and note the keycode value.Code:xev
Then run this:
That should disable the key. To make it permanent, put this command in the System, Preferences, Sessions, Startup Programs folder, Add.Code:xmodmap -e 'keycode number = NoSymbol'
Edit: Typo corrected. Thanks Sepero.
Last edited by drs305; June 17th, 2010 at 01:55 AM.
Thanks! Worked very nicely. When I press the key, however, it comes up with a hundred popups saying "action disallowed", lagging my system to death for about a minute. Is there any way I can disable that too?
EDIT: problem solved; I changed the value of suspend in Gnome-Power-Manager > Buttons to "nothing"
Thank you; this is a very useful tool. I have to go with vor's way though, because my computer can't recover from sleep mode, and therefore I can't note the keycodenumber >.<; And that way also prevents me from making it go into sleep/hibernate from the shutdown window.
Last edited by Deutscher Alex; June 28th, 2008 at 03:00 AM.
Quad Core Q6600 3GB RAM 300GB Hard DriveS nVidia GeForce 8400
Current Ubuntu Problems (2) PLEASE HELP!!:[NOT solved]Disappearing Firefox windows | [NOT SOLVED]AR5413 Atheros Card, NO linux support?
Current Vista Problems (1): It fails to boot
Quad Core Q6600 3GB RAM 300GB Hard DriveS nVidia GeForce 8400
Current Ubuntu Problems (2) PLEASE HELP!!:[NOT solved]Disappearing Firefox windows | [NOT SOLVED]AR5413 Atheros Card, NO linux support?
Current Vista Problems (1): It fails to boot
vor's method would certainly be the way to go in that it directly addresses the power mode instead of indirectly altering a key.
for future reference or other readers, there is an alternate method of discovering the keycode in cases such as this one where you might not want to actually press the key (d'oh!). you can run this and then find the keycode. for normal keys you could limit the output by adding " | grep symbol " but in this case the sleep key isn't called sleep, at least on my computer.
glad you were able to solve your problemCode:xmodmap -pke![]()
Sory to reply on a Solved thread but i have a question ,does it work only on X.Session because i wan't to disable a key at GRUB Boot Loader menu ?
Is that possible to block it through this tool ?
Only works with Xwindows. sorry
Bookmarks