Input for GamesInput IntroductionThis area contains notes on obtaining input for your game from the player. Notes on Input for GamesThere are a number of ways to get input for your game. You could simply trap Windows API messages using WM_KEYDOWN for the keyboard and WM_MOUSEMOVE for the mouse however there are some disadvantages to using those (lack of resolution and interpreted values). Instead you could use the Windows Raw Input API (built in) or the DirectX DirectInput API. Microsoft themselves are now saying for mouse and keyboard to not bother with DirectInput (it is still useful for joystick though) and instead yo use Raw Input. As a side note if you actually want to read input as text then you are advised to trap WM_CHAR messages as these are interpreted by Windows already for the locality (the other methods only return a raw key scan code). XInput is another DirectX API that is used for communicating with the XBox 360 common controller. - Raw Input - notes on using the windows' raw input functions to get mouse and keyboard input
- DirectInput - notes on setting up and using the DirectInput API from the DirectX SDK
- XInput - notes on using the new XInput API for communicating with the Xbox 360 common controller
|