2
* Copyright © 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Thomas Voss <thomas.voss@canonical.com>
19
#ifndef MIR_TOOLKIT_EVENT_H_
20
#define MIR_TOOLKIT_EVENT_H_
24
#include "mir_toolkit/common.h"
28
* \addtogroup mir_toolkit
33
/* TODO: To the moon. */
34
#define MIR_INPUT_EVENT_MAX_POINTER_COUNT 16
36
typedef int64_t nsecs_t;
41
mir_event_type_motion,
42
mir_event_type_surface,
43
mir_event_type_resize,
44
mir_event_type_prompt_session_state_change,
45
mir_event_type_orientation
49
mir_key_action_down = 0,
50
mir_key_action_up = 1,
51
mir_key_action_multiple = 2
55
mir_key_flag_woke_here = 0x1,
56
mir_key_flag_soft_keyboard = 0x2,
57
mir_key_flag_keep_touch_mode = 0x4,
58
mir_key_flag_from_system = 0x8,
59
mir_key_flag_editor_action = 0x10,
60
mir_key_flag_canceled = 0x20,
61
mir_key_flag_virtual_hard_key = 0x40,
62
mir_key_flag_long_press = 0x80,
63
mir_key_flag_canceled_long_press = 0x100,
64
mir_key_flag_tracking = 0x200,
65
mir_key_flag_fallback = 0x400
69
mir_key_modifier_none = 0,
70
mir_key_modifier_alt = 0x02,
71
mir_key_modifier_alt_left = 0x10,
72
mir_key_modifier_alt_right = 0x20,
73
mir_key_modifier_shift = 0x01,
74
mir_key_modifier_shift_left = 0x40,
75
mir_key_modifier_shift_right = 0x80,
76
mir_key_modifier_sym = 0x04,
77
mir_key_modifier_function = 0x08,
78
mir_key_modifier_ctrl = 0x1000,
79
mir_key_modifier_ctrl_left = 0x2000,
80
mir_key_modifier_ctrl_right = 0x4000,
81
mir_key_modifier_meta = 0x10000,
82
mir_key_modifier_meta_left = 0x20000,
83
mir_key_modifier_meta_right = 0x40000,
84
mir_key_modifier_caps_lock = 0x100000,
85
mir_key_modifier_num_lock = 0x200000,
86
mir_key_modifier_scroll_lock = 0x400000
90
mir_motion_action_down = 0,
91
mir_motion_action_up = 1,
92
mir_motion_action_move = 2,
93
mir_motion_action_cancel = 3,
94
mir_motion_action_outside = 4,
95
mir_motion_action_pointer_down = 5,
96
mir_motion_action_pointer_up = 6,
97
mir_motion_action_hover_move = 7,
98
mir_motion_action_scroll = 8,
99
mir_motion_action_hover_enter = 9,
100
mir_motion_action_hover_exit = 10
104
mir_motion_flag_window_is_obscured = 0x1
108
mir_motion_button_primary = 1 << 0,
109
mir_motion_button_secondary = 1 << 1,
110
mir_motion_button_tertiary = 1 << 2,
111
mir_motion_button_back = 1 << 3,
112
mir_motion_button_forward = 1 << 4
116
mir_motion_tool_type_unknown = 0,
117
mir_motion_tool_type_finger = 1,
118
mir_motion_tool_type_stylus = 2,
119
mir_motion_tool_type_mouse = 3,
120
mir_motion_tool_type_eraser = 4
131
unsigned int modifiers;
135
int32_t repeat_count;
153
MirMotionToolType tool_type;
166
* TODO(racarr): We would like to store this as a MirMotionAction but the android input stack
167
* encodes some non enumerable values in it. It's convenient to keep things
168
* this way for now until we can drop SF/Hybris support in QtUbuntu.
172
unsigned int modifiers;
175
MirMotionButton button_state;
183
size_t pointer_count;
184
MirMotionPointer pointer_coordinates[MIR_INPUT_EVENT_MAX_POINTER_COUNT];
185
/* "_coordinates" is a misnomer here because there's plenty more info than
186
just coordinates, but renaming it accurately would be an API break */
199
MirSurfaceAttrib attrib;
216
MirPromptSessionState new_state;
217
} MirPromptSessionEvent;
219
typedef struct MirOrientationEvent
224
MirOrientation direction;
225
} MirOrientationEvent;
231
MirMotionEvent motion;
232
MirSurfaceEvent surface;
233
MirResizeEvent resize;
234
MirPromptSessionEvent prompt_session;
235
MirOrientationEvent orientation;
243
#endif /* MIR_TOOLKIT_EVENT_H_ */