AutoHotkey Community

It is currently May 26th, 2012, 9:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Disabling the power key
PostPosted: August 8th, 2009, 10:00 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
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$$.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 9th, 2009, 10:10 pm 
Offline

Joined: May 17th, 2007, 6:03 pm
Posts: 391
Location: Titan
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 March 13th, 2011, 7:44 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2009, 12:02 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2009, 12:15 am 
Offline

Joined: May 17th, 2007, 6:03 pm
Posts: 391
Location: Titan
Yes, apparently PS/2 does not support HID protocol.

Have you tried keytweak?
http://webpages.charter.net/krumsick/

It seems to support some power management buttons and to work with PS/2 keyboards.

This page lists other programs/potential solutions to which you might want to give a try if keytweak does not work:
http://vlaurie.com/computers2/Articles/ ... yboard.htm


Edit: By the way, why don't you contact El Cheapo support service?
http://www.elcheapo.ca/
http://www.elcheapo.co.nz/
:wink:
________
Honda PC50 specifications


Last edited by lilalurl.T32 on March 13th, 2011, 7:44 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2009, 2:05 am 
Offline

Joined: August 8th, 2008, 7:26 pm
Posts: 117
Location: Raahe, Finland
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! :evil:

_________________
Hezzu - excuse the english!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2009, 2:10 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2009, 9:12 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
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.

lilalurl.T32 wrote:
Edit: By the way, why don't you contact El Cheapo support service?
http://www.elcheapo.ca/
http://www.elcheapo.co.nz/ :wink:

:P Okay, it isn't really, El Cheapo brand. It's actually GE, of all things, but it was the cheapest one in the store.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2009, 9:46 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 10th, 2009, 4:46 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Hey not bad! It makes the active window lose focus for some reason, but that should be fairly easy to deal with.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, Google [Bot], JSLover, virpara and 64 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group