PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

About WM_KEYDOWN.

Me again,

I am trying to trap a WM_KEYDOWN event from an EDIT control. I know the WM_COMMAND is passed to the control with a WM_KEYDOWN as the event when a key is pressed inside the control, but how can I know which key was pressed?

Regards,
Kornalius
Hmm, well usually in my callback function that checks for WM_COMMAND events is an argument passed that contains the virtual key-code of the key pressed (or let go). At that point, I just need to know the various keycodes or at least what to do with them.


JJB
It doesn't come as a command, just a WM_KEYDOWN message. The key code is contained in the WPARAM / LPARAM.

Dan East
Oh yeah that's right. Heh, I guess I always have them so close to one another in the callback function, I wasn't remembering clearly.

JJB
Problem I think is that I only have one callback for the parent window. Should I create a callback routine for each controls then?

Regards,
Kornalius
Ok I finally figured it out. I had to set a new callback procedure for the control (EDIT class) that I was creating.

Thanx for your time all,
Regards,
Kornalius