diff options
Diffstat (limited to 'platform/x11/os_x11.h')
| -rw-r--r-- | platform/x11/os_x11.h | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index bb8411e213..cf1619bae2 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,11 +48,9 @@ #include <X11/Xcursor/Xcursor.h> #include <X11/Xlib.h> +#include <X11/extensions/XInput2.h> #include <X11/extensions/Xrandr.h> #include <X11/keysym.h> -#ifdef TOUCH_ENABLED -#include <X11/extensions/XInput2.h> -#endif // Hints for X11 fullscreen typedef struct { @@ -121,23 +119,32 @@ class OS_X11 : public OS_Unix { bool im_active; Vector2 im_position; - Point2i last_mouse_pos; + Point2 last_mouse_pos; bool last_mouse_pos_valid; Point2i last_click_pos; uint64_t last_click_ms; + int last_click_button_index; uint32_t last_button_state; -#ifdef TOUCH_ENABLED + struct { int opcode; - Vector<int> devices; - XIEventMask event_mask; + Vector<int> touch_devices; + Map<int, Vector2> absolute_devices; + XIEventMask all_event_mask; + XIEventMask all_master_event_mask; Map<int, Vector2> state; Vector2 mouse_pos_to_filter; - } touch; -#endif + Vector2 relative_motion; + Vector2 raw_pos; + Vector2 old_raw_pos; + ::Time last_relative_time; + } xi; + + bool refresh_device_info(); - unsigned int get_mouse_button_state(unsigned int p_x11_state); + unsigned int get_mouse_button_state(unsigned int p_x11_button, int p_x11_type); void get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state); + void flush_mouse_motion(); MouseMode mouse_mode; Point2i center; |