#include <input.h>
Public Methods | |
Input () | |
~Input () | |
void | setRenderer (Renderer *prenderer) |
int | pollEvents () |
int | mouseX () |
int | mouseY () |
Vector | mousePos () |
int | relativeMouseX () |
int | relativeMouseY () |
int | timerTicks () |
int | diffTime () |
int | frameDelay () |
bool | mouseButton (int button) |
bool | mouseClicked (int button) |
bool | mouseReleased (int button) |
bool | key (int keycode) |
SDLMod | keyModifiers () |
bool | keyClicked (int keycode) |
void | setInputGrapping (bool onoff) |
void | showMouseCursor (bool onoff) |
bool | isMouseVisible (void) |
void | renderMouseCursor (void) |
Private Methods | |
void | handleEvent (SDL_Event *event) |
Private Attributes | |
bool | mouse_visible |
bool | mouse_sys_cursor |
SDL_Event | event |
bool | keys [512] |
bool | key_clicks [512] |
SDLMod | modifiers |
int | mouse_x |
int | mouse_y |
int | rel_mouse_x |
int | rel_mouse_y |
int | time_now |
int | time_prev |
bool | mouse_buttons [3] |
bool | mouse_clicked [3] |
bool | mouse_released [3] |
Renderer * | renderer |
|
|
|
|
|
Return time difference in ms between two pollEvents() calls.
|
|
Wait for new input events, in linux timers etc gets jerky if system load is too high so delays is needed :-(.
|
|
|
|
|
|
|
|
Return true if key is clicked between two pollEvents. This doesn't repeat key press.
|
|
Return currently pressed key modifiers (e.g. KMOD_CTRL, KMOD_ALT, KMOD_SHIFT etc.).
|
|
|
|
|
|
Return mouse position as Vector.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Supply a renderer pointer to be able to resize window.
|
|
|
|
Return elapsed time in ms since app start.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|