mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	button and axis events
This commit is contained in:
		
							parent
							
								
									e69b052a6d
								
							
						
					
					
						commit
						5f644d78fc
					
				
					 1 changed files with 11 additions and 9 deletions
				
			
		| 
						 | 
					@ -25,7 +25,7 @@ static void cursor_send_pointer_motion(struct sway_cursor *cursor,
 | 
				
			||||||
	swayc_t *swayc =
 | 
						swayc_t *swayc =
 | 
				
			||||||
		swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy);
 | 
							swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy);
 | 
				
			||||||
	if (swayc) {
 | 
						if (swayc) {
 | 
				
			||||||
		wlr_seat_pointer_enter(seat, surface, sx, sy);
 | 
							wlr_seat_pointer_notify_enter(seat, surface, sx, sy);
 | 
				
			||||||
		wlr_seat_pointer_notify_motion(seat, time, sx, sy);
 | 
							wlr_seat_pointer_notify_motion(seat, time, sx, sy);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		wlr_seat_pointer_clear_focus(seat);
 | 
							wlr_seat_pointer_clear_focus(seat);
 | 
				
			||||||
| 
						 | 
					@ -57,49 +57,51 @@ static void handle_cursor_button(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_cursor *cursor =
 | 
						struct sway_cursor *cursor =
 | 
				
			||||||
		wl_container_of(listener, cursor, button);
 | 
							wl_container_of(listener, cursor, button);
 | 
				
			||||||
	struct wlr_event_pointer_button *event = data;
 | 
						struct wlr_event_pointer_button *event = data;
 | 
				
			||||||
	sway_log(L_DEBUG, "TODO: handle event: %p", event);
 | 
						wlr_seat_pointer_notify_button(cursor->seat->seat, event->time_msec,
 | 
				
			||||||
 | 
							event->button, event->state);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_cursor_axis(struct wl_listener *listener, void *data) {
 | 
					static void handle_cursor_axis(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_cursor *cursor =
 | 
						struct sway_cursor *cursor =
 | 
				
			||||||
		wl_container_of(listener, cursor, axis);
 | 
							wl_container_of(listener, cursor, axis);
 | 
				
			||||||
	struct wlr_event_pointer_axis *event = data;
 | 
						struct wlr_event_pointer_axis *event = data;
 | 
				
			||||||
	sway_log(L_DEBUG, "TODO: handle event: %p", event);
 | 
						wlr_seat_pointer_notify_axis(cursor->seat->seat, event->time_msec,
 | 
				
			||||||
 | 
							event->orientation, event->delta);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_touch_down(struct wl_listener *listener, void *data) {
 | 
					static void handle_touch_down(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_cursor *cursor =
 | 
						struct sway_cursor *cursor =
 | 
				
			||||||
		wl_container_of(listener, cursor, touch_down);
 | 
							wl_container_of(listener, cursor, touch_down);
 | 
				
			||||||
	struct wlr_event_touch_down *event = data;
 | 
						struct wlr_event_touch_down *event = data;
 | 
				
			||||||
	sway_log(L_DEBUG, "TODO: handle event: %p", event);
 | 
						sway_log(L_DEBUG, "TODO: handle touch down event: %p", event);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_touch_up(struct wl_listener *listener, void *data) {
 | 
					static void handle_touch_up(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_cursor *cursor =
 | 
						struct sway_cursor *cursor =
 | 
				
			||||||
		wl_container_of(listener, cursor, touch_up);
 | 
							wl_container_of(listener, cursor, touch_up);
 | 
				
			||||||
	struct wlr_event_touch_up *event = data;
 | 
						struct wlr_event_touch_up *event = data;
 | 
				
			||||||
	sway_log(L_DEBUG, "TODO: handle event: %p", event);
 | 
						sway_log(L_DEBUG, "TODO: handle touch up event: %p", event);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_touch_motion(struct wl_listener *listener, void *data) {
 | 
					static void handle_touch_motion(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_cursor *cursor =
 | 
						struct sway_cursor *cursor =
 | 
				
			||||||
		wl_container_of(listener, cursor, touch_motion);
 | 
							wl_container_of(listener, cursor, touch_motion);
 | 
				
			||||||
	struct wlr_event_touch_motion *event = data;
 | 
						struct wlr_event_touch_motion *event = data;
 | 
				
			||||||
	sway_log(L_DEBUG, "TODO: handle event: %p", event);
 | 
						sway_log(L_DEBUG, "TODO: handle touch motion event: %p", event);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_tool_axis(struct wl_listener *listener, void *data) {
 | 
					static void handle_tool_axis(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_cursor *cursor =
 | 
						struct sway_cursor *cursor =
 | 
				
			||||||
		wl_container_of(listener, cursor, tool_axis);
 | 
							wl_container_of(listener, cursor, tool_axis);
 | 
				
			||||||
	struct wlr_event_tablet_tool_axis *event = data;
 | 
						struct wlr_event_tablet_tool_axis *event = data;
 | 
				
			||||||
	sway_log(L_DEBUG, "TODO: handle event: %p", event);
 | 
						sway_log(L_DEBUG, "TODO: handle tool axis event: %p", event);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_tool_tip(struct wl_listener *listener, void *data) {
 | 
					static void handle_tool_tip(struct wl_listener *listener, void *data) {
 | 
				
			||||||
	struct sway_cursor *cursor =
 | 
						struct sway_cursor *cursor =
 | 
				
			||||||
		wl_container_of(listener, cursor, tool_tip);
 | 
							wl_container_of(listener, cursor, tool_tip);
 | 
				
			||||||
	struct wlr_event_tablet_tool_tip *event = data;
 | 
						struct wlr_event_tablet_tool_tip *event = data;
 | 
				
			||||||
	sway_log(L_DEBUG, "TODO: handle event: %p", event);
 | 
						sway_log(L_DEBUG, "TODO: handle tool tip event: %p", event);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void handle_request_set_cursor(struct wl_listener *listener,
 | 
					static void handle_request_set_cursor(struct wl_listener *listener,
 | 
				
			||||||
| 
						 | 
					@ -107,7 +109,7 @@ static void handle_request_set_cursor(struct wl_listener *listener,
 | 
				
			||||||
	struct sway_cursor *cursor =
 | 
						struct sway_cursor *cursor =
 | 
				
			||||||
		wl_container_of(listener, cursor, request_set_cursor);
 | 
							wl_container_of(listener, cursor, request_set_cursor);
 | 
				
			||||||
	struct wlr_seat_pointer_request_set_cursor_event *event = data;
 | 
						struct wlr_seat_pointer_request_set_cursor_event *event = data;
 | 
				
			||||||
	sway_log(L_DEBUG, "TODO: handle event: %p", event);
 | 
						sway_log(L_DEBUG, "TODO: handle request set cursor event: %p", event);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
 | 
					struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue