The InputManager is the central Game Component for handling input. It is currently (as of release 0.90 capable of handling input of
  • Keyboard
  • Mouse (Windows PC only)
  • GamePad
  • Chatpad (XBox 360 only)
  • Accelerometer (Zune and Windows Phone, Debug emulation on Windows)
  • (Multi-) Touchscreen (Zune and Windows Phone, Windows 7)

The InputManager is not a simple component like as it is in most other engines. It is a complex but easy to use system to decouple input mechanisms from game logic. If you are creating a racing game for example, if player one is driving a car, the necessery information is maybe steering wheel rotation, acceleration and brake values. The InputManager is responsible to provide this information by collecting key, button and analog-stick (or wheel) information, handle and translate them and provide them in a way your game understands. You don't have to handle player index, connected controllers, controller capabilities, player preferences, button remapping and such thing. All this nasty things are handled internally.

There are different ways to use the InputManager:

The XBox is capable of handling four XBox-Controllers at once. These controllers are numbered from one to four which is equal to the port each controller is connected to. If there's more than one controller connected to the XBox there's a little problem: The InputManager and your game are not able to know which controller the player is using. If he always picks up the controller connected to port one everything is fine and this is how many games handle input. The starLiGHT.Engine will assist you to make it better. It is using the concept of a LogicalPlayer.

The InputManager is showcased in the starLiGHT.Sandbox.InputManager.

There are no InputManager tutorials available at the moment.

Last edited Dec 15, 2010 at 7:33 AM by Glatzemann, version 1

Comments

No comments yet.