scan code for Power Key on MC75

A Afshin Mansoorieh 3 years 7 months ago
1 5 0

Hi,I have a customer who is using SymScript to manage user inputs by using the ONKEY command. He is trying to capture the event representing pressing of the Power key.Does anyone know the scan-code for the power key?Thanks,

Afshin

Please Register or Login to post a reply

5 Replies

J Jarod Fox

The Microsoft recommended approach to simulate a power/suspend key press (at least for Windows Mobile) is to use the PowerPolicyNotify API #include    void func( void ){    PowerPolicyNotify( PPN_SUSPENDKEYPRESSED, 0 );    PowerPolicyNotify( PPN_SUSPENDKEYRELEASED, 0 );}

R Richard Linsley-Hood

What actual functionality is the customer trying to achieve and why? In general it is not possible to alter the effect of pressing the power key on our terminals but there are often ways to do things instead that do not require it. Richard LH

E Efkan YILMAZ

Richard is correct, there is no notification through the keyboard interfaces that the power key has been pressed. If you want to detect the power off, you would most likely need to do it through the Power Notification API's.  Then, if you'd like to override the power off event, you can. If you want to suspend (or, power off the unit) from a program, you can use the Keyboard API to send a VK_OFF (no kidding - it works).

J Juan-Antonio Martinez

Actually, you have to do in two steps: keybd_event(VK_OFF, 0, 0, 0);  keybd_event(VK_OFF, 0, KEYEVENTF_KEYUP, 0); On the other hand I remember that (on MC70, I have not tested on MC75) Suspend Notification's "executable" was not run when suspending... but when later resuming instead! Please check on MC75.

E Efkan YILMAZ

Afshin, You will not be able to capture the power key.

CONTACT
Can’t find what you’re looking for?