libwtk-sdl2  0.0.1
swipe.hpp
1 #ifndef LIBWTK_SDL2_SWIPE_HPP
2 #define LIBWTK_SDL2_SWIPE_HPP
3 
4 #include <optional>
5 #include <string>
6 
7 #include "mouse_event.hpp"
8 
10 {
11  int lower_threshold;
12  double dir_unambig_factor;
13 };
14 
15 enum class swipe_direction
16 {
17  UP,
18  DOWN,
19  LEFT,
20  RIGHT,
21 };
22 
23 struct swipe_info
24 {
25  enum class type
26  {
27  PRESS,
28  DIRECTION
29  };
30 
31  type type;
32 
33  // only valid if type is type::DIRECTION
34  swipe_direction dir;
35 };
36 
37 std::string to_string(swipe_direction dir);
38 
39 std::optional<swipe_info> get_swipe_info(mouse_movement const & m, swipe_config const & cfg);
40 
41 #endif
Definition: swipe.hpp:9
Definition: swipe.hpp:23
Definition: mouse_event.hpp:13