aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-10 10:08:16 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-12-10 10:08:16 -0500
commit5f644d78fc77f48c7f7d839f7c2e318b51c2c6d7 (patch)
tree44bb9aaf21f71783195b3f9c6ac4e36e09500695 /sway/input/cursor.c
parentworking pointer motion (diff)
downloadsway-5f644d78fc77f48c7f7d839f7c2e318b51c2c6d7.tar.gz
sway-5f644d78fc77f48c7f7d839f7c2e318b51c2c6d7.tar.zst
sway-5f644d78fc77f48c7f7d839f7c2e318b51c2c6d7.zip
button and axis events
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 059f907d..5f2d650e 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -25,7 +25,7 @@ static void cursor_send_pointer_motion(struct sway_cursor *cursor,
25 swayc_t *swayc = 25 swayc_t *swayc =
26 swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy); 26 swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy);
27 if (swayc) { 27 if (swayc) {
28 wlr_seat_pointer_enter(seat, surface, sx, sy); 28 wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
29 wlr_seat_pointer_notify_motion(seat, time, sx, sy); 29 wlr_seat_pointer_notify_motion(seat, time, sx, sy);
30 } else { 30 } else {
31 wlr_seat_pointer_clear_focus(seat); 31 wlr_seat_pointer_clear_focus(seat);
@@ -57,49 +57,51 @@ static void handle_cursor_button(struct wl_listener *listener, void *data) {
57 struct sway_cursor *cursor = 57 struct sway_cursor *cursor =
58 wl_container_of(listener, cursor, button); 58 wl_container_of(listener, cursor, button);
59 struct wlr_event_pointer_button *event = data; 59 struct wlr_event_pointer_button *event = data;
60 sway_log(L_DEBUG, "TODO: handle event: %p", event); 60 wlr_seat_pointer_notify_button(cursor->seat->seat, event->time_msec,
61 event->button, event->state);
61} 62}
62 63
63static void handle_cursor_axis(struct wl_listener *listener, void *data) { 64static void handle_cursor_axis(struct wl_listener *listener, void *data) {
64 struct sway_cursor *cursor = 65 struct sway_cursor *cursor =
65 wl_container_of(listener, cursor, axis); 66 wl_container_of(listener, cursor, axis);
66 struct wlr_event_pointer_axis *event = data; 67 struct wlr_event_pointer_axis *event = data;
67 sway_log(L_DEBUG, "TODO: handle event: %p", event); 68 wlr_seat_pointer_notify_axis(cursor->seat->seat, event->time_msec,
69 event->orientation, event->delta);
68} 70}
69 71
70static void handle_touch_down(struct wl_listener *listener, void *data) { 72static void handle_touch_down(struct wl_listener *listener, void *data) {
71 struct sway_cursor *cursor = 73 struct sway_cursor *cursor =
72 wl_container_of(listener, cursor, touch_down); 74 wl_container_of(listener, cursor, touch_down);
73 struct wlr_event_touch_down *event = data; 75 struct wlr_event_touch_down *event = data;
74 sway_log(L_DEBUG, "TODO: handle event: %p", event); 76 sway_log(L_DEBUG, "TODO: handle touch down event: %p", event);
75} 77}
76 78
77static void handle_touch_up(struct wl_listener *listener, void *data) { 79static void handle_touch_up(struct wl_listener *listener, void *data) {
78 struct sway_cursor *cursor = 80 struct sway_cursor *cursor =
79 wl_container_of(listener, cursor, touch_up); 81 wl_container_of(listener, cursor, touch_up);
80 struct wlr_event_touch_up *event = data; 82 struct wlr_event_touch_up *event = data;
81 sway_log(L_DEBUG, "TODO: handle event: %p", event); 83 sway_log(L_DEBUG, "TODO: handle touch up event: %p", event);
82} 84}
83 85
84static void handle_touch_motion(struct wl_listener *listener, void *data) { 86static void handle_touch_motion(struct wl_listener *listener, void *data) {
85 struct sway_cursor *cursor = 87 struct sway_cursor *cursor =
86 wl_container_of(listener, cursor, touch_motion); 88 wl_container_of(listener, cursor, touch_motion);
87 struct wlr_event_touch_motion *event = data; 89 struct wlr_event_touch_motion *event = data;
88 sway_log(L_DEBUG, "TODO: handle event: %p", event); 90 sway_log(L_DEBUG, "TODO: handle touch motion event: %p", event);
89} 91}
90 92
91static void handle_tool_axis(struct wl_listener *listener, void *data) { 93static void handle_tool_axis(struct wl_listener *listener, void *data) {
92 struct sway_cursor *cursor = 94 struct sway_cursor *cursor =
93 wl_container_of(listener, cursor, tool_axis); 95 wl_container_of(listener, cursor, tool_axis);
94 struct wlr_event_tablet_tool_axis *event = data; 96 struct wlr_event_tablet_tool_axis *event = data;
95 sway_log(L_DEBUG, "TODO: handle event: %p", event); 97 sway_log(L_DEBUG, "TODO: handle tool axis event: %p", event);
96} 98}
97 99
98static void handle_tool_tip(struct wl_listener *listener, void *data) { 100static void handle_tool_tip(struct wl_listener *listener, void *data) {
99 struct sway_cursor *cursor = 101 struct sway_cursor *cursor =
100 wl_container_of(listener, cursor, tool_tip); 102 wl_container_of(listener, cursor, tool_tip);
101 struct wlr_event_tablet_tool_tip *event = data; 103 struct wlr_event_tablet_tool_tip *event = data;
102 sway_log(L_DEBUG, "TODO: handle event: %p", event); 104 sway_log(L_DEBUG, "TODO: handle tool tip event: %p", event);
103} 105}
104 106
105static void handle_request_set_cursor(struct wl_listener *listener, 107static void handle_request_set_cursor(struct wl_listener *listener,
@@ -107,7 +109,7 @@ static void handle_request_set_cursor(struct wl_listener *listener,
107 struct sway_cursor *cursor = 109 struct sway_cursor *cursor =
108 wl_container_of(listener, cursor, request_set_cursor); 110 wl_container_of(listener, cursor, request_set_cursor);
109 struct wlr_seat_pointer_request_set_cursor_event *event = data; 111 struct wlr_seat_pointer_request_set_cursor_event *event = data;
110 sway_log(L_DEBUG, "TODO: handle event: %p", event); 112 sway_log(L_DEBUG, "TODO: handle request set cursor event: %p", event);
111} 113}
112 114
113struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { 115struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {