Input manager interfacing with input methods provided by a GameWindow.
More...
|
| InputManager () |
| Creates a new InputManager with only basic low-level input support. More...
|
|
| InputManager (GameWindow window) |
| Creates a new InputManager associated with the specified GameWindow. More...
|
|
void | Update () |
| Updates the input manager, refreshing all current and previous states. More...
|
|
bool | IsKeyUp (Key key) |
| Returns whether or not the specified key is currently unpressed. More...
|
|
bool | IsKeyDown (Key key) |
| Returns whether or not the specified key is currently being pressed. More...
|
|
bool | KeyPressed (Key key) |
| Returns whether or not the specified key has been pressed. More...
|
|
bool | KeyReleased (Key key) |
| Returns whether or not the specified key has been released. More...
|
|
bool | IsMouseUp (MouseButton button) |
| Returns whether or not the specified mouse button is currently unpressed. More...
|
|
bool | IsMouseDown (MouseButton button) |
| Returns whether or not the specified mouse button is currently being pressed. More...
|
|
bool | MousePressed (MouseButton button) |
| Returns whether or not the specified mouse button has been pressed. More...
|
|
bool | MouseReleased (MouseButton button) |
| Returns whether or not the specified mouse button has been released. More...
|
|
bool | IsWheelUp () |
| Returns whether the mouse wheel was scrolled up. More...
|
|
bool | IsWheelDown () |
| Returns whether the mouse wheel was scrolled down. More...
|
|
bool | IsWheelChanged () |
| Returns whether the mouse wheel scrolled at all. More...
|
|
int | WheelChange () |
| Returns the mouse wheel's change in value. More...
|
|
|
KeyDownEventHandler | KeyDown |
| Raised when a key is pressed down. More...
|
|
KeyUpEventHandler | KeyUp |
| Raised when a key is released. More...
|
|
KeyPressEventHandler | KeyPress |
| Raised when a character is typed. More...
|
|
MouseDownEventHandler | MouseDown |
| Raised when a mouse button is pressed down. More...
|
|
MouseUpEventHandler | MouseUp |
| Raised when a mouse button is released. More...
|
|
MouseWheelChangedEventHandler | WheelChanged |
| Raised when the mouse wheel value changes. More...
|
|
MouseWheelDownEventHandler | WheelDown |
| Raised when the mouse wheel is scrolled downwards. More...
|
|
MouseWheelUpEventHandler | WheelUp |
| Raised when the mouse wheel is scrolled upwards. More...
|
|
KeyDownEventHandler | KeyDown |
| Raised when a key is pressed down. More...
|
|
KeyUpEventHandler | KeyUp |
| Raised when a key is released. More...
|
|
KeyPressEventHandler | KeyPress |
| Raised when a character is typed. More...
|
|
MouseDownEventHandler | MouseDown |
| Raised when a mouse button is pressed down. More...
|
|
MouseUpEventHandler | MouseUp |
| Raised when a mouse button is released. More...
|
|
MouseWheelChangedEventHandler | WheelChanged |
| Raised when the mouse wheel value changes. More...
|
|
MouseWheelDownEventHandler | WheelDown |
| Raised when the mouse wheel is scrolled downwards. More...
|
|
MouseWheelUpEventHandler | WheelUp |
| Raised when the mouse wheel is scrolled upwards. More...
|
|
Input manager interfacing with input methods provided by a GameWindow.
TriDevs.TriEngine.Input.InputManager.InputManager |
( |
| ) |
|
Creates a new InputManager with only basic low-level input support.
Creating InputManager without a driver container will cause the events to be useless and never be raised, only the methods on this class will return any useful info. If you want event support, construct the InputManager with a GameWindow or other supported driver providers (NYI).
113 _mouse =
new MouseDevice();
TriDevs.TriEngine.Input.InputManager.InputManager |
( |
GameWindow |
window | ) |
|
Creates a new InputManager associated with the specified GameWindow.
- Parameters
-
124 _keyboard = window.Keyboard;
125 _mouse = window.Mouse;
126 _keyboard.KeyDown += OnKeyDown;
127 _keyboard.KeyUp += OnKeyUp;
128 window.KeyPress += OnKeyPress;
129 _mouse.ButtonDown += OnMouseDown;
130 _mouse.ButtonUp += OnMouseUp;
131 _mouse.WheelChanged += OnMouseWheelChanged;
bool TriDevs.TriEngine.Input.InputManager.IsKeyDown |
( |
Key |
key | ) |
|
Returns whether or not the specified key is currently being pressed.
- Parameters
-
- Returns
- True if key is currently being pressed, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
202 return _keyboardState[key];
bool TriDevs.TriEngine.Input.InputManager.IsKeyUp |
( |
Key |
key | ) |
|
Returns whether or not the specified key is currently unpressed.
- Parameters
-
- Returns
- True if the key is currently up (not pressed), false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
197 return !_keyboardState[key];
bool TriDevs.TriEngine.Input.InputManager.IsMouseDown |
( |
MouseButton |
button | ) |
|
Returns whether or not the specified mouse button is currently being pressed.
- Parameters
-
button | The button to query for. |
- Returns
- True if button is currently being pressed, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
222 return _mouseState[button];
bool TriDevs.TriEngine.Input.InputManager.IsMouseUp |
( |
MouseButton |
button | ) |
|
Returns whether or not the specified mouse button is currently unpressed.
- Parameters
-
button | Button to query for. |
- Returns
- True if the button is currently up (not pressed), false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
217 return !_mouseState[button];
bool TriDevs.TriEngine.Input.InputManager.IsWheelChanged |
( |
| ) |
|
Returns whether the mouse wheel scrolled at all.
- Returns
- True if the mouse wheel scrolled, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
247 return _mouseState.Wheel != _lastMouseState.Wheel;
bool TriDevs.TriEngine.Input.InputManager.IsWheelDown |
( |
| ) |
|
Returns whether the mouse wheel was scrolled down.
- Returns
- True if mouse wheel was scrolled down, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
242 return _mouseState.Wheel < _lastMouseState.Wheel;
bool TriDevs.TriEngine.Input.InputManager.IsWheelUp |
( |
| ) |
|
Returns whether the mouse wheel was scrolled up.
- Returns
- True if mouse wheel was scrolled up, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
237 return _mouseState.Wheel > _lastMouseState.Wheel;
bool TriDevs.TriEngine.Input.InputManager.KeyPressed |
( |
Key |
key | ) |
|
Returns whether or not the specified key has been pressed.
Only returns true if the last state of the key was not pressed.
- Parameters
-
- Returns
- True if key was pressed, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
207 return _keyboardState[key] && !_lastKeyboardState[key];
bool TriDevs.TriEngine.Input.InputManager.KeyReleased |
( |
Key |
key | ) |
|
Returns whether or not the specified key has been released.
Only returns true if the last state of the key was pressed.
- Parameters
-
- Returns
- True if key was released, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
212 return !_keyboardState[key] && _lastKeyboardState[key];
bool TriDevs.TriEngine.Input.InputManager.MousePressed |
( |
MouseButton |
button | ) |
|
Returns whether or not the specified mouse button has been pressed.
Only returns true if the last state of the mouse button was not pressed.
- Parameters
-
button | Button to query for. |
- Returns
- True if button was pressed, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
227 return _mouseState[button] && !_lastMouseState[button];
bool TriDevs.TriEngine.Input.InputManager.MouseReleased |
( |
MouseButton |
button | ) |
|
Returns whether or not the specified mouse button has been released.
Only returns true if the last state of the button was pressed.
- Parameters
-
button | The button to query for. |
- Returns
- True if the button was released, false otherwise.
Implements TriDevs.TriEngine.Input.IInputManager.
232 return !_mouseState[button] && _lastMouseState[button];
void TriDevs.TriEngine.Input.InputManager.Update |
( |
| ) |
|
Updates the input manager, refreshing all current and previous states.
Implements TriDevs.TriEngine.Input.IInputManager.
188 _lastKeyboardState = _keyboardState;
189 _keyboardState = Keyboard.GetState();
191 _lastMouseState = _mouseState;
192 _mouseState = Mouse.GetState();
int TriDevs.TriEngine.Input.InputManager.WheelChange |
( |
| ) |
|
Returns the mouse wheel's change in value.
- Returns
- Negative value if wheel scrolled down, positive value if scrolled up, zero if not scrolled.
Implements TriDevs.TriEngine.Input.IInputManager.
252 return _mouseState.Wheel - _lastMouseState.Wheel;
Point<int> TriDevs.TriEngine.Input.InputManager.MousePosition |
|
get |
int TriDevs.TriEngine.Input.InputManager.MouseWheelValue |
|
get |
int TriDevs.TriEngine.Input.InputManager.MouseX |
|
get |
int TriDevs.TriEngine.Input.InputManager.MouseY |
|
get |
bool TriDevs.TriEngine.Input.InputManager.this[Key key] |
|
get |
bool TriDevs.TriEngine.Input.InputManager.this[MouseButton button] |
|
get |
KeyDownEventHandler TriDevs.TriEngine.Input.InputManager.KeyDown |
Raised when a key is pressed down.
KeyPressEventHandler TriDevs.TriEngine.Input.InputManager.KeyPress |
Raised when a character is typed.
KeyUpEventHandler TriDevs.TriEngine.Input.InputManager.KeyUp |
Raised when a key is released.
MouseDownEventHandler TriDevs.TriEngine.Input.InputManager.MouseDown |
Raised when a mouse button is pressed down.
MouseUpEventHandler TriDevs.TriEngine.Input.InputManager.MouseUp |
Raised when a mouse button is released.
MouseWheelChangedEventHandler TriDevs.TriEngine.Input.InputManager.WheelChanged |
Raised when the mouse wheel value changes.
MouseWheelDownEventHandler TriDevs.TriEngine.Input.InputManager.WheelDown |
Raised when the mouse wheel is scrolled downwards.
MouseWheelUpEventHandler TriDevs.TriEngine.Input.InputManager.WheelUp |
Raised when the mouse wheel is scrolled upwards.
The documentation for this class was generated from the following file: