13#include <unordered_map>
30 virtual bool OnEvent(
const SEvent &event);
115 switch (input_type) {
118 return scale.keyboard_mouse;
122 return scale.joystick;
150 std::array<float, GameKeyType::INTERNAL_ENUM_COUNT>
axisValues;
187 return value > 0 ? std::min(1.0f, value) * INT16_MAX : 0;
192 return value > 0 ? value / (f32)INT16_MAX : 0.0f;
215 virtual void step(
float dtime) {}
317 virtual void step(
float dtime);
319 s32
Rand(s32 min, s32 max);
322 std::bitset<GameKeyType::INTERNAL_ENUM_COUNT>
keydown;
InputType
The type of the input value.
Definition keycode.h:27
@ GAMEPAD_AXIS_PLUS
Gamepad axis in the positive direction.
Definition keycode.h:32
@ MOUSE_BUTTON
Mouse button input.
Definition keycode.h:29
@ GAMEPAD_AXIS_MINUS
Gamepad axis in the negative direction.
Definition keycode.h:33
@ GAMEPAD_BUTTON
Gamepad button.
Definition keycode.h:31
@ KEYBOARD
Keyboard input (scancodes).
Definition keycode.h:28
@ ESC
Definition keys.h:24
@ INTERNAL_ENUM_COUNT
Definition keys.h:104
Definition inputhandler.h:27
std::array< Keybinding, KeyType::INTERNAL_ENUM_COUNT > keybindings
Definition inputhandler.h:139
void reloadKeybindings()
Definition inputhandler.cpp:31
std::pair< float, bool > checkKeyDown(GameKeyType action) const
Definition inputhandler.cpp:189
void listenForKey(KeyPress keyCode, GameKeyType action)
Definition inputhandler.h:93
bool WasKeyPressed(GameKeyType key) const
Definition inputhandler.h:46
void releaseAllKeys()
Definition inputhandler.h:72
s32 mouse_wheel
Definition inputhandler.h:144
std::unordered_map< KeyPress, GameKeyType > keysListenedFor
Definition inputhandler.h:162
bool WasKeyReleased(GameKeyType key) const
Definition inputhandler.h:50
virtual bool OnEvent(const SEvent &event)
Definition inputhandler.cpp:203
std::array< float, GameKeyType::INTERNAL_ENUM_COUNT > axisValues
Definition inputhandler.h:150
float repeat_joystick_button_time
Definition inputhandler.h:142
std::map< KeyPress, PhysicalKeyState > physicalKeyDown
Definition inputhandler.h:147
PointerType getLastPointerType()
Definition inputhandler.h:90
bool fullscreen_is_down
Definition inputhandler.h:165
std::bitset< GameKeyType::INTERNAL_ENUM_COUNT > keyWasReleased
Definition inputhandler.h:159
bool IsKeyDown(GameKeyType key) const
Definition inputhandler.h:36
bool esc_down
Definition inputhandler.h:168
float GetAxisValue(GameKeyType key) const
Definition inputhandler.h:33
void clearWasKeyReleased()
Definition inputhandler.h:85
s32 getMouseWheel()
Definition inputhandler.h:54
void clearInput()
Definition inputhandler.h:61
std::bitset< GameKeyType::INTERNAL_ENUM_COUNT > keyWasDown
Definition inputhandler.h:153
PointerType last_pointer_type
Definition inputhandler.h:170
std::bitset< GameKeyType::INTERNAL_ENUM_COUNT > keyWasPressed
Definition inputhandler.h:156
bool setKeyDown(KeyPress keyCode, float value)
Definition inputhandler.cpp:149
bool close_world_down
Definition inputhandler.h:167
void clearWasKeyPressed()
Definition inputhandler.h:80
bool WasKeyDown(GameKeyType key)
Definition inputhandler.cpp:124
core::vector2d< s32 > v2s32
Definition irr_v2d.h:13
KeyType::T GameKeyType
Definition keys.h:109
struct MyEventReceiver::Keybinding::@224352171233173203231251207143015257330236066165 scale
Keybinding(const std::vector< KeyPress > &in_keys)
Definition inputhandler.h:111
float getScale(KeyPress::InputType input_type) const
Definition inputhandler.h:113
std::vector< KeyPress > keys
Definition inputhandler.h:104
float keyboard_mouse
Definition inputhandler.h:106
float joystick
Definition inputhandler.h:107
Definition inputhandler.h:129
f64 last_binary_update
Definition inputhandler.h:131
float analog_value
Definition inputhandler.h:130
constexpr v3f x
Definition test_irr_matrix4.cpp:18
constexpr v3f y
Definition test_irr_matrix4.cpp:19