13#include <unordered_map>
30 virtual bool OnEvent(
const SEvent &event);
126 switch (input_type) {
129 return scale.keyboard_mouse;
133 return scale.joystick;
161 std::array<float, GameKeyType::INTERNAL_ENUM_COUNT>
axisValues;
201 return value > 0 ? std::min(1.0f, value) * INT16_MAX : 0;
206 return value > 0 ? value / (f32)INT16_MAX : 0.0f;
231 virtual void step(
float dtime) {}
345 virtual void step(
float dtime);
347 s32
Rand(s32 min, s32 max);
350 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:150
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:104
bool WasKeyPressed(GameKeyType key) const
Definition inputhandler.h:46
void releaseAllKeys()
Definition inputhandler.h:83
s32 mouse_wheel
Definition inputhandler.h:155
std::unordered_map< KeyPress, GameKeyType > keysListenedFor
Definition inputhandler.h:173
v2s32 mouse_movement
Definition inputhandler.h:184
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:161
float repeat_joystick_button_time
Definition inputhandler.h:153
std::map< KeyPress, PhysicalKeyState > physicalKeyDown
Definition inputhandler.h:158
PointerType getLastPointerType()
Definition inputhandler.h:101
bool fullscreen_is_down
Definition inputhandler.h:176
std::bitset< GameKeyType::INTERNAL_ENUM_COUNT > keyWasReleased
Definition inputhandler.h:170
bool IsKeyDown(GameKeyType key) const
Definition inputhandler.h:36
bool esc_down
Definition inputhandler.h:179
float GetAxisValue(GameKeyType key) const
Definition inputhandler.h:33
void clearWasKeyReleased()
Definition inputhandler.h:96
s32 getMouseWheel()
Definition inputhandler.h:54
void clearInput()
Definition inputhandler.h:71
std::bitset< GameKeyType::INTERNAL_ENUM_COUNT > keyWasDown
Definition inputhandler.h:164
PointerType last_pointer_type
Definition inputhandler.h:181
std::bitset< GameKeyType::INTERNAL_ENUM_COUNT > keyWasPressed
Definition inputhandler.h:167
v2s32 getMouseMovement()
Definition inputhandler.h:64
bool setKeyDown(KeyPress keyCode, float value)
Definition inputhandler.cpp:149
bool close_world_down
Definition inputhandler.h:178
void clearWasKeyPressed()
Definition inputhandler.h:91
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:122
float getScale(KeyPress::InputType input_type) const
Definition inputhandler.h:124
std::vector< KeyPress > keys
Definition inputhandler.h:115
float keyboard_mouse
Definition inputhandler.h:117
float joystick
Definition inputhandler.h:118
Definition inputhandler.h:140
f64 last_binary_update
Definition inputhandler.h:142
float analog_value
Definition inputhandler.h:141
constexpr v3f x
Definition test_irr_matrix4.cpp:18
constexpr v3f y
Definition test_irr_matrix4.cpp:19