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
scan code for Power Key on MC75Hi,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 |
Subscribe to email updates
Monthly updates from our Zebra development team, straight to your inbox.
5 Replies
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 );}
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
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).
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.
Afshin, You will not be able to capture the power key.