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


About Keypress Event

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