Trap keyboard keys

  • Thread starter Thread starter Zanna
  • Start date Start date
Z

Zanna

Hi,

I'm trying to use the OpenNETCF ApplicationEx as described in

http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=1513

to trap keyboard events.

I get some problems: it works, but

- I get each keypress, so if the key is keeped pressed I get a queue of
events that I don't want.

- I cannot get the key and the modifier at the same time.

- It seems to trap something else, e.g. mouse events and sometime this
is interpreted (wrong!) as a keycode.

Someone can help me?

Thanks
 
To get the modifier, follow the instructions that I gave: call
GetKeyState( VK_CONTROL ) (or whatever modifier you want).

My guess on the other event stuff is that you are not filtering the events
you are looking at by the event type, which would be WM_KEYDOWN for the
application you mentioned before.

Paul T.
 
Paul G. Tobey [eMVP] ha scritto:
To get the modifier, follow the instructions that I gave: call
GetKeyState( VK_CONTROL ) (or whatever modifier you want).

My guess on the other event stuff is that you are not filtering the events
you are looking at by the event type, which would be WM_KEYDOWN for the
application you mentioned before.

Yes... it was that.

You know if there is a way to convert lParam e wParam into KeyEventArgs?

Thanks
 
I don't know of an easy way. I'm sure you could brute force it...

Paul T.

Zanna said:
Paul G. Tobey [eMVP] ha scritto:
To get the modifier, follow the instructions that I gave: call
GetKeyState( VK_CONTROL ) (or whatever modifier you want).

My guess on the other event stuff is that you are not filtering the events
you are looking at by the event type, which would be WM_KEYDOWN for the
application you mentioned before.

Yes... it was that.

You know if there is a way to convert lParam e wParam into KeyEventArgs?

Thanks
 
Back
Top