Team, we have a ISV wanting to use the PTT key within their app and they need the keycode. Keycheck doesn't seem to display WM_CHAR number. And just to complicate things I have remapped the PTT key to be Button 1 on the device (Button1 is set to open the customer's app). So my second question is; will the keycode still work within the app if the key has been remapped. regards, Daniel
MC75A: PTT button keycode query// Expert user has replied. |
5 Replies
Dan, My suggestion for this would be to only use the registry keys to remap the PTT button i.e. you can remap PTT to launch an app using this format: [HKEY_LOCAL_MACHINE\Software\Symbol\ProgrammableKeys\P4] "CommandLine"="" "ApplicationPath"="\windows\start menu\programs\otl.exe" "Action"=dword:00000001 When (or just before) you start the customer app, the app can change the PPT registry key to generate a keypress ( the registry changes are effective immediately without a reboot) as shown previously. If this method is used, the WM_CHAR character is generated when the PTT key is pressed so it should work as they require.
Best Regards,
Ian Hatton
Hey Ian, thanks for the response mate. In my situation I have already remapped the PTT key using KBTools so the remapping side is OK. I remapped it to be Button1 and then assigned the customer's app to be Button1. The issue is the softeware vendor wants to capture the PTT button event within the app (once the app has started) and have some function be performed when pushed. (even though outside of the app the PTT button is remapped to starting up the app. In order for the customer to use the PTT button in their app they need the Keycode. However Keycheck doesn't show the WM_CHAR. It only shows the Keydown and KeyUp portions. Please see attached screen shot which show 005D for the WM_KEYDOWN & WM_KEYUP of the PTT button, but not the WM_CHAR. (But if I hit the ,"w", button for example, I get KEYDOWN, KEYUP and WM_CHAR info. Hope this makes sense. cheers, Dan regards, Daniel.
You use the API RegisterHotKey() to register for notification of a hot (app key) key press. It will send the application a WM_HOTKEY message when its pressed.
It should be taken care to register for the particular PTT key when the specified app get activated and unregister when that app get deactivated. Otherwise no other app can register/use hot key for PTT.
Dan, PTT (and volume up/down) key can be remapped via a registry key as follows: [HKEY_LOCAL_MACHINE\Software\Symbol\ProgrammableKeys\P4] "CommandLine"="" "ApplicationPath="" "Action"=dword:00000002 “KeyCode”=dword:0000000d “Modifier”=dword:00000000 The keycode specifies the code to be generated when the key is pressed (in this case 0d = enter) Best Regards, Ian Hatton EMS EMEA