17 #ifndef HEADER_SUPERTUX_CONTROL_CONTROLLER_HPP 18 #define HEADER_SUPERTUX_CONTROL_CONTROLLER_HPP 52 std::ostream& operator<<(std::ostream& os, Control control);
54 std::string Control_to_string(Control control);
55 std::optional<Control> Control_from_string(
const std::string& text);
63 virtual void update();
65 void set_control(Control control,
bool value);
67 void set_jump_key_with_up(
bool value);
70 void set_touchscreen(
bool value);
73 bool hold(Control control)
const;
76 bool pressed(Control control)
const;
78 template<
typename... Control>
79 bool pressed_any(Control&&... controls)
const 81 for(
const auto& control : {controls... })
90 bool released(Control control)
const;
95 bool is_touchscreen()
const;
99 bool m_controls[
static_cast<int>(Control::CONTROLCOUNT)];
102 bool m_old_controls[
static_cast<int>(Control::CONTROLCOUNT)];
Definition: controller.hpp:57
bool m_touchscreen
the event has been generated by touchscreen
Definition: controller.hpp:105
bool m_jump_key_pressed
the jump key is pressed for this controller
Definition: controller.hpp:108