View Single Post
  #6  
Old April 27th 20, 09:19 AM posted to microsoft.public.windowsxp.general
R.Wieser
external usenet poster
 
Posts: 1,302
Default How to disable a keyboards shutdown and sleep keys ?

JJ,

The keyboars's power management keys aren't disableable or mappable
by user code,


I noticed that when I tried to spot those keystrokes using SetWindowsHookEx
using WH_KEYBOARD_LL. I saw nothing for those keys.

One way to disable the Power and Sleep keys, is to reconfigure the
system's
global power scheme using WriteGlobalPwrPolicy() function, and change the
PowerButtonAc, PowerButtonDc, SleepButtonAc, and SleepButtonDc fields
to a value which represent a do-nothing.


Thats something to look at. Maybe it allows for creating a bit more
fine-grained response (differing between the actual power button and the
keyboard key)

The alternative way is to create a keyboard filter driver which
changes power management key scan codes before they're
handled by the kernel.


I've never made changes /that/ deep in the 'puter. And I'm not at all sure
that I'm even capable of making such a driver ...

Oops, I forgot that this isn't a programming newsgroup. I


Perhaps the "wrong" newsgroup, but the right person. :-)

In this case, use the Power Options's Advanced tab to configure what
the keyboard Power and Sleep keys should do.


:-) Already did that.

Thanks for thr suggestions.

Regards,
Rudy Wieser


Ads