![]() |
|
#1
|
|||
|
|||
Win32 API Keyboard eventsI'm creating an openGL-based pong program and I want to do the keyboard detection with the win32 API.
What are the events for it? I don't have any experience w/ keyboard input on C++ other than cin, sooo any help would be appreciated. |
|
#2
|
||||
|
||||
|
Hi JBowe. Welcome to GIDForums.
Do you have the conio library with your compiler? If so, there should be a function called kbhit() included that may help. It will return a 0 until a key is hit and then it will return that keyhit. I am not sure if this is what you are looking for or not. It is not strictly a Windows API but is pretty simple if it works for you. |
|
#3
|
||||
|
||||
|
Quote:
http://msdn.microsoft.com/library/de...y_category.asp |
|
#4
|
|||
|
|||
|
If you are using bare-bones Win32 API, I think you need something like
WM_CHAR. In your WinMain() function, you probably have a loop with something like the following: CPP / C++ / C Code:
then in your CALLBACK WindowProcedure(), there is a switch: CPP / C++ / C Code:
More information probably should come from a windows programming group. Dave |
|
#5
|
|||
|
|||
|
Seeing no response, I will post my own followup:
Your question is more about Windows programming than about C or C++ programming. This forum has lots of people willing to answer C and/or C++ questions (and to give advice from lots of different points of view). Windows programming is a whole 'nother topic. For more information about keyboard input in a Windows API application, you can go to http://msdn.microsoft.com, enter keyboard input in the search window, click go and enjoy! Regards, Dave |
Recent GIDBlog
Stupid Management Policies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| list of the most common keyboard and mouse shortcuts for IE, Opera and Firebird | jrobbio | Computer Software Forum - Windows | 2 | 04-Sep-2003 10:10 |
| A complete Apache + PHP + MySQL Package for Win32 | nickbeee | MySQL / PHP Forum | 1 | 11-Sep-2001 22:07 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The