#include <sdlinput.hpp>
Inheritance diagram for gcn::SDLInput:
Definition at line 73 of file sdlinput.hpp.
Public Member Functions | |
SDLInput () | |
Constructor. | |
virtual void | pushInput (SDL_Event event) |
Pushes an SDL event. | |
virtual void | _pollInput () |
Polls all input. | |
virtual bool | isKeyQueueEmpty () |
Checks whether the key queue is empty or not. | |
virtual KeyInput | dequeueKeyInput () |
Dequeues the key input queue. | |
virtual bool | isMouseQueueEmpty () |
Checks whether the mouse queue is empyt or not. | |
virtual MouseInput | dequeueMouseInput () |
Dequeues the mouse input queue. | |
Protected Member Functions | |
int | convertMouseButton (int button) |
Converts a mouse button from SDL to a Guichan mouse button representation. | |
Key | convertKeyCharacter (SDL_keysym key) |
Converts an SDL keysym to a Key object. | |
Protected Attributes | |
std::queue< KeyInput > | mKeyInputQueue |
std::queue< MouseInput > | mMouseInputQueue |
bool | mMouseDown |
bool | mMouseInWindow |
|
Polls all input. It exists for input driver compatibility. If you only use SDL and plan sticking with SDL you can safely ignore this function as it in the SDL case does nothing. Implements gcn::Input. Definition at line 95 of file sdlinput.hpp. |
|
Converts an SDL keysym to a Key object.
Definition at line 213 of file sdlinput.cpp. References gcn::Key::setAltPressed(), gcn::Key::setControlPressed(), gcn::Key::setMetaPressed(), gcn::Key::setNumericPad(), gcn::Key::setShiftPressed(), and gcn::Key::setValue(). Referenced by pushInput(). |
|
Converts a mouse button from SDL to a Guichan mouse button representation.
Definition at line 187 of file sdlinput.cpp. Referenced by pushInput(). |
|
Dequeues the key input queue.
Implements gcn::Input. Definition at line 74 of file sdlinput.cpp. |
|
Dequeues the mouse input queue.
Implements gcn::Input. Definition at line 94 of file sdlinput.cpp. |
|
Checks whether the key queue is empty or not.
Implements gcn::Input. Definition at line 69 of file sdlinput.cpp. |
|
Checks whether the mouse queue is empyt or not.
Implements gcn::Input. Definition at line 89 of file sdlinput.cpp. |
|
Pushes an SDL event. It should be called at least once per frame to update input with user input.
Definition at line 109 of file sdlinput.cpp. References convertKeyCharacter(), convertMouseButton(), gcn::MouseInput::setButton(), gcn::KeyInput::setKey(), gcn::MouseInput::setTimeStamp(), gcn::MouseInput::setType(), gcn::KeyInput::setType(), gcn::MouseInput::x, and gcn::MouseInput::y. |