|
Colobot
|
Management of mouse, keyboard and joystick. More...
#include <src/app/input.h>

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