• Advertisement


This topic is now archived and is closed to further replies.

About Keypress Event

This topic is 5333 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I design a class KeyPressEvent, and want to send it
while the key pressed.
This event's subject is which key pressed.

I use DirectInput API to read keyboard,
the below is my code:
KeyBoard->GetDeviceState(sizeof(buffer), (LPVOID)&buffer); for (i = 0; i < 256; ++i) { if ( buffer & 0x80 ) // send key_press_event }

Is this a good way? Or something better?
-- Eric L.C. Shang-kuan [edited by - ericsk on August 13, 2003 10:25:14 AM]

Share this post

Link to post
Share on other sites

  • Advertisement