![]() |
Space Fighter
A "shmup" game for Computer Programming C++
|
Handles the state of multiple player input devices. More...
#include <InputState.h>
Public Member Functions | |
| InputState () | |
| virtual | ~InputState () |
| bool | IsKeyDown (Key key) const |
| Determines if a keyboard key is currently being pressed down. | |
| bool | IsKeyUp (Key key) const |
| Determines if a keyboard key is currently not being pressed down. | |
| bool | IsNewKeyPress (Key key) const |
| Determines if a keyboard key was just pressed this frame. | |
| bool | IsNewKeyRelease (Key key) const |
| Determines if a keyboard key was just released this frame. | |
| Point | GetMousePosition () const |
| Gets the current screen position of the mouse cursor. | |
| bool | IsMouseButtonDown (MouseButton button) const |
| Determines if a mouse button is currently being pressed down. | |
| bool | IsMouseButtonUp (MouseButton button) const |
| Determines if a mouse button is currently not being pressed down. | |
| bool | WasMouseButtonDown (MouseButton button) const |
| Determines if a mouse button was being pressed down during the previous frame. | |
| bool | WasMouseButtonUp (MouseButton button) const |
| Determines if a mouse button was not being pressed down during the previous frame. | |
| bool | IsNewMouseButtonPress (MouseButton button) const |
| Determines if a mouse button was just pressed this frame. | |
| bool | IsNewMouseButtonRelease (MouseButton button) const |
| Determines if a mouse button was just released this frame. | |
| bool | IsButtonUp (Button button, int8_t &indexOut, int8_t controllingIndex=-1) const |
| Determines if a the button on an Xbox controller is up. | |
| bool | IsButtonDown (Button button, int8_t &indexOut, int8_t controllingIndex=-1) const |
| Determines if a the button on an Xbox controller is down. | |
| bool | IsNewButtonPress (Button button, int8_t &indexOut, int8_t controllingIndex=-1) const |
| Determines if a the button on an Xbox controller was just pressed this frame. | |
| bool | IsNewButtonRelease (Button button, int8_t &indexOut, int8_t controllingIndex=-1) const |
| Determines if a the button on an Xbox controller just released this frame. | |
| GamePadState | GetGamePadState (const int8_t gamePadIndex) const |
| Get the current state of an Xbox controller. | |
Static Public Attributes | |
| static const uint8_t | MAX_NUM_GAMEPADSTATES = 4 |
| The maximum number of Xbox controllers that the system can manage. | |
Friends | |
| class | Game |
Handles the state of multiple player input devices.
Definition at line 21 of file InputState.h.
| KatanaEngine::InputState::InputState | ( | ) |
Definition at line 19 of file InputState.cpp.
|
inlinevirtual |
Definition at line 31 of file InputState.h.
| GamePadState KatanaEngine::InputState::GetGamePadState | ( | const int8_t | gamePadIndex | ) | const |
Get the current state of an Xbox controller.
| gamePadIndex | The index of the desired game pad state. |
Definition at line 274 of file InputState.cpp.
|
inline |
Gets the current screen position of the mouse cursor.
Definition at line 56 of file InputState.h.
| bool KatanaEngine::InputState::IsButtonDown | ( | Button | button, |
| int8_t & | indexOut, | ||
| int8_t | controllingIndex = -1 ) const |
Determines if a the button on an Xbox controller is down.
| button | The button to test. |
| indexOut | The index of the controller with the pressed button. |
| controllingIndex | The index of the controller to test. If the controllingIndex is not valid, all controllers will be tested indexOut will be set to the first detected index matching the condition. |
Definition at line 215 of file InputState.cpp.
| bool KatanaEngine::InputState::IsButtonUp | ( | Button | button, |
| int8_t & | indexOut, | ||
| int8_t | controllingIndex = -1 ) const |
Determines if a the button on an Xbox controller is up.
| button | The button to test. |
| indexOut | The index of the controller with the released button. |
| controllingIndex | The index of the controller to test. If the controllingIndex is not valid, all controllers will be tested indexOut will be set to the first detected index matching the condition. |
Definition at line 196 of file InputState.cpp.
| bool KatanaEngine::InputState::IsKeyDown | ( | Key | key | ) | const |
Determines if a keyboard key is currently being pressed down.
| key | The key to test. |
Definition at line 176 of file InputState.cpp.
| bool KatanaEngine::InputState::IsKeyUp | ( | Key | key | ) | const |
Determines if a keyboard key is currently not being pressed down.
| key | The key to test. |
Definition at line 181 of file InputState.cpp.
|
inline |
Determines if a mouse button is currently being pressed down.
| button | The button to test. |
Definition at line 61 of file InputState.h.
|
inline |
Determines if a mouse button is currently not being pressed down.
| button | The button to test. |
Definition at line 66 of file InputState.h.
| bool KatanaEngine::InputState::IsNewButtonPress | ( | Button | button, |
| int8_t & | indexOut, | ||
| int8_t | controllingIndex = -1 ) const |
Determines if a the button on an Xbox controller was just pressed this frame.
| button | The button to test. |
| indexOut | The index of the controller with the pressed button. |
| controllingIndex | The index of the controller to test. If the controllingIndex is not valid, all controllers will be tested indexOut will be set to the first detected index matching the condition. |
Definition at line 234 of file InputState.cpp.
| bool KatanaEngine::InputState::IsNewButtonRelease | ( | Button | button, |
| int8_t & | indexOut, | ||
| int8_t | controllingIndex = -1 ) const |
Determines if a the button on an Xbox controller just released this frame.
| button | The button to test. |
| indexOut | The index of the controller with the released button. |
| controllingIndex | The index of the controller to test. If the controllingIndex is not valid, all controllers will be tested indexOut will be set to the first detected index matching the condition. |
Definition at line 254 of file InputState.cpp.
| bool KatanaEngine::InputState::IsNewKeyPress | ( | Key | key | ) | const |
Determines if a keyboard key was just pressed this frame.
| key | The key to test. |
Definition at line 186 of file InputState.cpp.
| bool KatanaEngine::InputState::IsNewKeyRelease | ( | Key | key | ) | const |
Determines if a keyboard key was just released this frame.
| key | The key to test. |
Definition at line 191 of file InputState.cpp.
|
inline |
Determines if a mouse button was just pressed this frame.
| button | The button to test. |
Definition at line 81 of file InputState.h.
|
inline |
Determines if a mouse button was just released this frame.
| button | The button to test. |
Definition at line 86 of file InputState.h.
|
inline |
Determines if a mouse button was being pressed down during the previous frame.
| button | The button to test. |
Definition at line 71 of file InputState.h.
|
inline |
Determines if a mouse button was not being pressed down during the previous frame.
| button | The button to test. |
Definition at line 76 of file InputState.h.
|
friend |
Definition at line 23 of file InputState.h.
|
static |
The maximum number of Xbox controllers that the system can manage.
Definition at line 28 of file InputState.h.