Skip to main content
gamedev.net
🔒 Locked

Keyboard input

Started by dwfait 2 replies 550+ views
Original Post
dwfait
dwfait
This is in C++.. How do you get the raw input from the keyboard? Not from what the user has entered into the console, as i wish to exit as the user presses the Esc key.
bjogio
bjogio
this question should be posted in the "for beginners" forum. Anyway if you want "raw" input in win32 OS you should check a library called DirectInput that is part of the biggest DirectX.
[ILTUOMONDOFUTURO]
Enselic
Enselic
If you only wish to check if the ESC key is down I think that initiating DirectInput is overkill. Instead, I would advice you to use this call:
if( 0x80 & GetAsyncKeyState( VK_ESCAPE ) )	// Escape key is down

You can get additional information at this page: GetAsyncKeyState Function

Don't forget to #include

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.