Jump to content
  • Advertisement


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


about input

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

Hot could I handle keyboard input, it must support multiple keys pressed at same time.I am using PTC if that helps.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
windows, dos, linux, beos? gotta expand there man. Dos, just use the scan codes(lookem up, there out there), and getch, or use dos interrupts and write a simple assembly handler. windows 32bit app, just use the message handler for KEYDOWN event and the getasynchronous function. You cant us dos interrupts for keyboard input in assembly language under windows 32bit protected apps, big time crash. PTC, no, that doesnt help, all i know is that ptc is a graphics library or something, but not sure how it handles keyboard routines.

Share this post

Link to post
Share on other sites
test for key down:
#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)

and just in case you want it, test for key up:
#define KEY_UP (vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)

use like so:




you get the idea

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!