Many thanks to the good folks over at OpenNetCF.org and the users who post into the forums. I've taken the basic code in This Thread and created a wrapper class for the Pocket PC RegisterHotKey / UnregisterHotKey API calls.
Essentially what I needed to do was create a hotkey button on a Pocket PC Windows form to allow a user to either click menu items with the stylus or to click the various keys on their keyboard and navigate around the app that way. I initially started going down the route trying to find an SDK method inside of the Symbol SDK for the specific device that we are devloping against. However, I was unable to find any kind of global KeyPress event and SetWindowsHookEx is not supported in the compact framework.
After much frustration and almost giving up on the idea, I finally ran into the post mentioned above and was able to convert the sample form provided into a class that wraps the registration / unregistration of hotkeys on the Pocket PC. The best part is, since this is using API calls from the Pocket PC itself, it's device independant. I don't have to worry about it working / not working in my emulator vs. the actual device.
I've Posted The Wrapper Class Here for anyone who needs to create any kind of keyboard hook on the compact framework.
Here's an example of how to use this class:
Private WithEvents hk As New HotKeys
Private Sub Form_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
hk.Register(Keys.X, HotKeys.KeyModifiers.Control)
hk.Register(Keys.Y, HotKeys.KeyModifiers.Control)
End Sub
Private Sub Form_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
hk.UnRegister(Keys.X)
hk.UnRegister(Keys.Y)
End Sub
Private Sub hk_KeyPress(ByVal key As Keys) Handles hk.KeyPressed
MsgBox("You Pressed ctrl-" & key.ToString)
End Sub