Jump to content
  • Advertisement


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


About Keypress Event

This topic is 5458 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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!