Colobot
|
Management of mouse, keyboard and joystick. More...
#include <input.h>
Public Member Functions | |
CInput () | |
Constructor. | |
void | EventProcess (Event &event) |
Process an incoming event, also sets .kmodState, .mousePos, .mouseButtonsState and .key.slot. | |
void | MouseMove (Math::IntPoint pos) |
Called by CApplication on SDL MOUSE_MOTION event. | |
int | GetKmods () const |
Returns the current key modifiers. | |
bool | GetKmodState (int kmod) const |
Returns whether the given kmod is active. | |
bool | GetKeyState (InputSlot key) const |
Returns whether the key is pressed. | |
bool | GetMouseButtonState (int index) const |
Returns whether the mouse button is pressed. | |
void | ResetKeyStates () |
Resets tracked key states and modifiers. | |
Math::Point | GetMousePos () const |
Returns the position of mouse cursor (in interface coords) | |
void | SetDefaultInputBindings () |
Sets the default input bindings (keys and joystick axes) | |
InputSlot | FindBinding (unsigned int key) |
Get binding slot for given key. | |
InputSlot | SearchKeyById (std::string name) |
Seeks a InputSlot by id. Returns INPUT_SLOT_MAX if not found. | |
void | SetInputBinding (InputSlot slot, InputBinding binding) |
Management of input bindings. | |
const InputBinding & | GetInputBinding (InputSlot slot) |
void | SetJoyAxisBinding (JoyAxisSlot slot, JoyAxisBinding binding) |
Management of joystick axis bindings. | |
const JoyAxisBinding & | GetJoyAxisBinding (JoyAxisSlot slot) |
void | SetJoystickDeadzone (float zone) |
Management of joystick deadzone. | |
float | GetJoystickDeadzone () |
void | SaveKeyBindings () |
Saving/loading key bindings to colobot.ini. | |
void | LoadKeyBindings () |
std::string | GetKeysString (InputBinding binding) |
Returns string describing keys to be pressed. | |
std::string | GetKeysString (InputSlot slot) |
Additional Inherited Members | |
![]() | |
static CInput & | GetInstance () |
static CInput * | GetInstancePointer () |
static bool | IsCreated () |
![]() | |
static CInput * | m_instance = nullptr |
Management of mouse, keyboard and joystick.