Polycode::CoreInput Class Reference

User input event dispatcher. More...

Inherits Polycode::EventDispatcher.

List of all members.

Public Member Functions

Vector2 getMousePosition ()
 Returns the current mouse position.
bool getKeyState (PolyKEY keyCode)
 Returns the state of the specified key.
Vector2 getMouseDelta ()
 Returns the current mouse position as delta from last frame.
bool getMouseButtonState (int mouseButton)
 Returns the state of the specified mouse button.

Static Public Attributes

static const int MOUSE_BUTTON1 = 0
 Left mouse button.
static const int MOUSE_BUTTON2 = 1
 Right mouse button.
static const int MOUSE_BUTTON3 = 2
 Middle mouse button.

Detailed Description

User input event dispatcher.

The Core input class is where all of the input events originate. You can add event listeners to this class to listen for user input events or poll it manually to check the state of user input.


Member Function Documentation

bool Polycode::CoreInput::getKeyState ( PolyKEY  keyCode  ) 

Returns the state of the specified key.

Parameters:
keyCode The key to check for
Returns:
True if the key is pressed, false otherwise.
bool Polycode::CoreInput::getMouseButtonState ( int  mouseButton  ) 

Returns the state of the specified mouse button.

Parameters:
mouseButton Mouse button to check the state of. Possible values are CoreInput::MOUSE_BUTTON1, CoreInput::MOUSE_BUTTON2 and CoreInput::MOUSE_BUTTON3
Returns:
True if the button is pressed, false otherwise.
Vector2 Polycode::CoreInput::getMouseDelta (  ) 

Returns the current mouse position as delta from last frame.

Returns:
Mouse position as a 2d vector delta from last frame.
Vector2 Polycode::CoreInput::getMousePosition (  ) 

Returns the current mouse position.

Returns:
Mouse position as a 2d vector.
Generated on Sat Aug 11 18:04:11 2012 for Polycode by  doxygen 1.6.3