Mindshifter.InputManager Class Reference

InputManager handles the querying and processing of input data from the mouse and keyboard, and provides functions for retrieving the current input state as well as its change in state from frame to frame. Input handling callbacks are supported through action maps, which can be pushed and popped from the input manager's internal stack. More...

Inherits Mindshifter.IInputManager.

Inheritance diagram for Mindshifter.InputManager:

Inheritance graph
[legend]
Collaboration diagram for Mindshifter.InputManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InputManager (Game game)
 Creates a new instance of Input.
void PushActionMap (ActionMap map)
 Pushes an ActionMap onto the action map stack.
ActionMap PopActionMap ()
 Pops the topmost ActionMap from the ActionMap stack.
override void Update (GameTime gameTime)
 Updates the keyboard and mouse states.
bool Key (XI.Keys key)
 Returns true if the specified keyboard key is pressed.
bool KeyDown (XI.Keys key)
 Returns true if a key down event occurred for the specified key.
bool KeyUp (XI.Keys key)
 Returns true if a key up event occurred for the specified key.
bool MouseButton (MouseButtons button)
 Returns true if the specified mouse button is pressed.
bool MouseDown (MouseButtons button)
 Returns true if a mouse down event occurred for the specified mouse button.
bool MouseUp (MouseButtons button)
 Returns true if a mouse up event occurred for the specified mouse button.

Static Public Member Functions

static void Initialize (Game game)
 Initializes the input manager, adding an InputManager instance to the specified game's component set and adding the IInputManager interface to the game's services.

Properties

XI.KeyboardState Keyboard [get]
 Gets the current keyboard state.
XI.KeyboardState KeyboardPrevious [get]
 Gets the previous keyboard state (shorthand accessor).
XI.MouseState Mouse [get]
 Gets the current mouse state.
XI.MouseState MousePrevious [get]
 Private shorthand accessor.
int DX [get]
 Gets the change in the mouse x position since input was last updated.
int DY [get]
 Gets the change in the mouse y position since input was last updated.
int DZ [get]
 Gets the change in the mouse scroll wheel position since input was last updated.
int X [get]
 Gets the x position of the mouse.
int Y [get]
 Gets the y position of the mouse.
int Z [get]
 Gets the current value of the mouse scroll wheel.
ActionMap ActionMap [get]
 Gets the active ActionMap.
bool this [XI.Keys key] [get]
 Returns true if the specified mouse button is pressed.

Private Types

enum  InputState { Current, Previous }
 Defines the state of an input set, either current or previous. More...

Private Attributes

Dictionary< InputState, XI.KeyboardState > mKeyboard
Dictionary< InputState, XI.MouseState > mMouse
Stack< ActionMapmActionMaps

Detailed Description

InputManager handles the querying and processing of input data from the mouse and keyboard, and provides functions for retrieving the current input state as well as its change in state from frame to frame. Input handling callbacks are supported through action maps, which can be pushed and popped from the input manager's internal stack.


Member Enumeration Documentation

enum Mindshifter::InputManager::InputState [private]

Defines the state of an input set, either current or previous.

Enumerator:
Current 
Previous 


Constructor & Destructor Documentation

Mindshifter.InputManager.InputManager ( Game  game  ) 

Creates a new instance of Input.

Parameters:
game The XNA Game instance


Member Function Documentation

static void Mindshifter.InputManager.Initialize ( Game  game  )  [static]

Initializes the input manager, adding an InputManager instance to the specified game's component set and adding the IInputManager interface to the game's services.

Parameters:
game The game using the input manager

void Mindshifter.InputManager.PushActionMap ( ActionMap  map  ) 

Pushes an ActionMap onto the action map stack.

Parameters:
map The ActionMap to push onto the ActionMap stack

Implements Mindshifter.IInputManager.

ActionMap Mindshifter.InputManager.PopActionMap (  ) 

Pops the topmost ActionMap from the ActionMap stack.

Returns:
The ActionMap that was popped from the ActionMap stack

Implements Mindshifter.IInputManager.

override void Mindshifter.InputManager.Update ( GameTime  gameTime  ) 

Updates the keyboard and mouse states.

Parameters:
gameTime Current XNA game time

bool Mindshifter.InputManager.Key ( XI.Keys  key  ) 

Returns true if the specified keyboard key is pressed.

Parameters:
key The key to test for a key pressed state
Returns:
True if the specified keyboard key is pressed, false otherwise

bool Mindshifter.InputManager.KeyDown ( XI.Keys  key  ) 

Returns true if a key down event occurred for the specified key.

Parameters:
key The key to test for a key down event
Returns:
True if the specified keyboard key triggered a key down event, false otherwise

bool Mindshifter.InputManager.KeyUp ( XI.Keys  key  ) 

Returns true if a key up event occurred for the specified key.

Parameters:
key The key to test for a key up event
Returns:
True if the specified keyboard key triggered a key up event, false otherwise

bool Mindshifter.InputManager.MouseButton ( MouseButtons  button  ) 

Returns true if the specified mouse button is pressed.

Parameters:
button The mouse button to test for a button pressed state
Returns:
True if the specified mouse button is pressed, false otherwise

Implements Mindshifter.IInputManager.

bool Mindshifter.InputManager.MouseDown ( MouseButtons  button  ) 

Returns true if a mouse down event occurred for the specified mouse button.

Parameters:
button The mouse button to test for a mouse down event
Returns:
True if the specified mouse button triggered a mouse down event

Implements Mindshifter.IInputManager.

bool Mindshifter.InputManager.MouseUp ( MouseButtons  button  ) 

Returns true if a mouse up event occurred for the specified mouse button.

Parameters:
button The mouse button to test for a mouse up event
Returns:
True if the specified mouse button triggered a mouse up event

Implements Mindshifter.IInputManager.


Member Data Documentation

Dictionary<InputState, XI.KeyboardState> Mindshifter.InputManager.mKeyboard [private]

Dictionary<InputState, XI.MouseState> Mindshifter.InputManager.mMouse [private]

Stack<ActionMap> Mindshifter.InputManager.mActionMaps [private]


Property Documentation

XI.KeyboardState Mindshifter.InputManager.Keyboard [get]

Gets the current keyboard state.

Implements Mindshifter.IInputManager.

XI.KeyboardState Mindshifter.InputManager.KeyboardPrevious [get, private]

Gets the previous keyboard state (shorthand accessor).

XI.MouseState Mindshifter.InputManager.Mouse [get]

Gets the current mouse state.

Implements Mindshifter.IInputManager.

XI.MouseState Mindshifter.InputManager.MousePrevious [get, private]

Private shorthand accessor.

int Mindshifter.InputManager.DX [get]

Gets the change in the mouse x position since input was last updated.

Implements Mindshifter.IInputManager.

int Mindshifter.InputManager.DY [get]

Gets the change in the mouse y position since input was last updated.

Implements Mindshifter.IInputManager.

int Mindshifter.InputManager.DZ [get]

Gets the change in the mouse scroll wheel position since input was last updated.

Implements Mindshifter.IInputManager.

int Mindshifter.InputManager.X [get]

Gets the x position of the mouse.

Implements Mindshifter.IInputManager.

int Mindshifter.InputManager.Y [get]

Gets the y position of the mouse.

Implements Mindshifter.IInputManager.

int Mindshifter.InputManager.Z [get]

Gets the current value of the mouse scroll wheel.

Implements Mindshifter.IInputManager.

ActionMap Mindshifter.InputManager.ActionMap [get]

Gets the active ActionMap.

Implements Mindshifter.IInputManager.

bool Mindshifter.InputManager::this (  )  [get]

Returns true if the specified mouse button is pressed.

Parameters:
key The key to test for a key pressed state
Returns:
True if the specified keyboard key is pressed, false otherwise

Implements Mindshifter.IInputManager.


The documentation for this class was generated from the following file:
Generated on Thu Apr 10 01:31:14 2008 for InputManager by  doxygen 1.5.1-p1