Manages initialization and shutdown of the input system.
More...
|
| ~Input () |
|
bool | down (Button btn) const |
| Returns true if a button is currently pressed.
|
|
double | mouseX () const |
| Returns the horizontal position of the mouse relative to the top left corner of the window given to Input's constructor.
|
|
double | mouseY () const |
| See mouseX.
|
|
void | setMousePosition (double x, double y) |
| Immediately moves the mouse as far towards the desired position as possible.
|
|
void | setMouseFactors (double factorX, double factorY) |
|
const Touches & | currentTouches () const |
| Currently known touches.
|
|
double | accelerometerX () const |
| Accelerometer positions in all three dimensions (smoothened).
|
|
double | accelerometerY () const |
|
double | accelerometerZ () const |
|
void | update () |
| Collects new information about which buttons are pressed, where the mouse is and calls onButtonUp/onButtonDown, if assigned.
|
|
TextInput * | textInput () const |
| Returns the currently active TextInput instance, or 0.
|
|
void | setTextInput (TextInput *input) |
| Sets the currently active TextInput, or clears it (input = 0).
|
|
|
static wchar_t | idToChar (Button btn) |
| Returns the character a button usually produces, or 0.
|
|
static Button | charToId (wchar_t ch) |
| Returns the button that has to be pressed to produce the given character, or noButton.
|
|
Manages initialization and shutdown of the input system.
Only one Input instance can exist per application.
Definition at line 82 of file Input.hpp.
double Gosu::Input::accelerometerX |
( |
| ) |
const |
Accelerometer positions in all three dimensions (smoothened).
double Gosu::Input::accelerometerY |
( |
| ) |
const |
double Gosu::Input::accelerometerZ |
( |
| ) |
const |
static Button Gosu::Input::charToId |
( |
wchar_t |
ch | ) |
|
|
static |
Returns the button that has to be pressed to produce the given character, or noButton.
const Touches& Gosu::Input::currentTouches |
( |
| ) |
const |
bool Gosu::Input::down |
( |
Button |
btn | ) |
const |
Returns true if a button is currently pressed.
Updated every tick.
static wchar_t Gosu::Input::idToChar |
( |
Button |
btn | ) |
|
|
static |
Returns the character a button usually produces, or 0.
double Gosu::Input::mouseX |
( |
| ) |
const |
Returns the horizontal position of the mouse relative to the top left corner of the window given to Input's constructor.
double Gosu::Input::mouseY |
( |
| ) |
const |
void Gosu::Input::setMouseFactors |
( |
double |
factorX, |
|
|
double |
factorY |
|
) |
| |
void Gosu::Input::setMousePosition |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Immediately moves the mouse as far towards the desired position as possible.
x and y are relativ to the window just as in the mouse position accessors.
void Gosu::Input::setTextInput |
( |
TextInput * |
input | ) |
|
Sets the currently active TextInput, or clears it (input = 0).
Returns the currently active TextInput instance, or 0.
void Gosu::Input::update |
( |
| ) |
|
Collects new information about which buttons are pressed, where the mouse is and calls onButtonUp/onButtonDown, if assigned.
std::tr1::function<void (Button)> Gosu::Input::onButtonDown |
Assignable events that are called by update.
You can bind these to your own functions. If you use the Window class, it will assign forward these to its own methods.
Definition at line 147 of file Input.hpp.
std::tr1::function<void (Button)> Gosu::Input::onButtonUp |
std::tr1::function<void (Touch)> Gosu::Input::onTouchBegan |
Assignable events that are called by update.
You can bind these to your own functions. If you use the Window class, it will assign forward these to its own methods.
Definition at line 151 of file Input.hpp.
std::tr1::function<void (Touch)> Gosu::Input::onTouchEnded |
std::tr1::function<void (Touch)> Gosu::Input::onTouchMoved |
The documentation for this class was generated from the following file: