1 #ifndef MSP_INPUT_TOUCHSCREEN_H_
2 #define MSP_INPUT_TOUCHSCREEN_H_
4 #include <sigc++/trackable.h>
5 #include <msp/graphics/window.h>
11 class Touchscreen: public Device, public sigc::trackable
14 static constexpr unsigned UNUSED = static_cast<unsigned>(-1);
16 Graphics::Window &window;
17 std::vector<unsigned> active_points;
20 Touchscreen(Graphics::Window &);
23 static bool is_available();
25 Graphics::Window &get_window() const { return window; }
27 std::string get_button_name(unsigned) const override;
28 std::string get_axis_name(unsigned) const override;
30 void input_event(const Graphics::Window::Event &);
32 unsigned map_point_id(unsigned);
33 void touch_down(unsigned);
34 void touch_move(unsigned, float, float);
35 void touch_up(unsigned);