| View previous topic :: View next topic |
| Author |
Message |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Sat Aug 08, 2009 9:00 pm Post subject: Disabling the power key |
|
|
I'm sure there have been threads on this before, but I couldn't find one just now, so oh well. Has anyone found a way to disable (or repurpose) the power-off key on a keyboard without interfering with the main power button on the case?
I just got a keyboard that has power management buttons in the dumbest place possible (right above the arrow keys), I know it's only a matter of of time before they bite my in the a$$. |
|
| Back to top |
|
 |
lilalurl.T32
Joined: 17 May 2007 Posts: 391 Location: Titan
|
Posted: Sun Aug 09, 2009 9:10 pm Post subject: |
|
|
Have you tried with AHKHID?
http://www.autohotkey.com/forum/viewtopic.php?t=41397
I think it intercepts the key strokes so hopefully it will not trigger the shutdown command when you try and see its event code.
Otherwise, is it an exotic keyboard or a branded keyboard (Logitech, MS etc...)? You can usually find online some registry settings to modify to change thebehaviour of this kind of keys.
You might not like the idea, but if it fails and you can't find another solution, you still have the option to physically remove the key (either by forcing it out or after unscrewing the keyboard). Just place some sellotape above the hole once it is done.
________
FAMILY GUY FORUM
Last edited by lilalurl.T32 on Sun Mar 13, 2011 6:44 am; edited 1 time in total |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Sun Aug 09, 2009 11:02 pm Post subject: |
|
|
| HID is only for USB, devices, isn't it? This keyboard is PS2. Or am I wrong about that? The dismemberment option had occurred to me and it's an El Cheapo keyboard, so I don't mind too much, but obviously it's not ideal. I wasn't aware there might be a registry hack, so thanks for that idea, I'll look into it. |
|
| Back to top |
|
 |
lilalurl.T32
Joined: 17 May 2007 Posts: 391 Location: Titan
|
|
| Back to top |
|
 |
Hezzu
Joined: 08 Aug 2008 Posts: 117 Location: Raahe, Finland
|
Posted: Mon Aug 10, 2009 1:05 am Post subject: |
|
|
Dude, I feel your pain
for the past 3 keyboards i've had (10 years) i've had 2 with a HUGE power off/sleep buttons and on the second keyboard the button was on the way, so that when I grabbed the keyboard I accidentally hit the button.
now it is not on the way but still it is indimitatingly HUGE I mean other buttons are like half an inch but this is inch wide.
I just wanna choke the engineer that made the god forsaken button!  _________________ Hezzu - excuse the english! |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Aug 10, 2009 1:10 am Post subject: |
|
|
if u never use it and not planning to use it, well as suggested
just kill it
taking the button out is a little bit ugly, so take out the button and "cut" the connect part to make it shorter, so it wont touch even u press that mf key |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Mon Aug 10, 2009 8:12 am Post subject: |
|
|
The problem is, when I try to remap the key, AutoHotkey can detect it, and do something, but Windows still "sees" too. I had hopes for that KeyTweak program you suggested, since it modifies the registry, but it had the same result anyway.
I'll check out some of those other links, but I don't really expect anything different. It seems these keys are handled at a low level that is very difficult to block, kind of like Win+L I guess.
Thanks for all the advice though.
Okay, it isn't really, El Cheapo brand. It's actually GE, of all things, but it was the cheapest one in the store. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Mon Aug 10, 2009 8:46 am Post subject: |
|
|
| ManaUser wrote: | | It seems these keys are handled at a low level that is very difficult to block, kind of like Win+L I guess. |
If you cannot block the key, you could try cancelling the Shutdown atleast.
My KB does not have a Power button so I am simulating it with a Hotkey.
| Code: | #SingleInstance, Force
DllCall( "kernel32.dll\SetProcessShutdownParameters", UInt, 0x4FF, UInt, 0 )
OnMessage(0x11, "WM_QUERYENDSESSION")
Return
^F12:: ; Replace ^F12 with Scancode of Power Button
PowerButton := True
ShutDown, 8 ; Remove this line
Return
WM_QUERYENDSESSION() {
Global PowerButton
IfEqual,PowerButton,1, Return, ( PowerButton := False )
Else Return True
} |
Adapt the above code by changing the lines in Red |
|
| Back to top |
|
 |
ManaUser
Joined: 24 May 2007 Posts: 1121
|
Posted: Mon Aug 10, 2009 3:46 pm Post subject: |
|
|
| Hey not bad! It makes the active window lose focus for some reason, but that should be fairly easy to deal with. |
|
| Back to top |
|
 |
|