Trap keyboard keys

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
 
P

Paul G. Tobey [eMVP]

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.
 
Z

Zanna

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
 
P

Paul G. Tobey [eMVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top