Mir
toolkit_event.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2020 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 or 3 as
6  * published by the Free Software Foundation.
7  *
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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef MIRAL_TOOLKIT_EVENT_H_
18 #define MIRAL_TOOLKIT_EVENT_H_
19 
21 
22 #include <xkbcommon/xkbcommon.h>
23 
24 struct MirEvent;
25 struct MirKeyboardEvent;
26 struct MirTouchEvent;
27 struct MirPointerEvent;
28 struct MirInputEvent;
29 
35 typedef int32_t MirTouchId;
36 
37 namespace miral
38 {
39 namespace toolkit
40 {
50 
59 MirInputEvent const* mir_event_get_input_event(MirEvent const* event);
60 
62 // * Retrieves the device id responsible for generating an input event.
63 // *
64 // * \param [in] event The input event
65 // * \return The id of the generating device
66 // */
67 //MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const* event);
68 
75 int64_t mir_input_event_get_event_time(MirInputEvent const* event);
76 
83 MirInputEventType mir_input_event_get_type(MirInputEvent const* event);
84 
92 MirKeyboardEvent const* mir_input_event_get_keyboard_event(MirInputEvent const* event);
93 
101 MirTouchEvent const* mir_input_event_get_touch_event(MirInputEvent const* event);
102 
110 MirPointerEvent const* mir_input_event_get_pointer_event(MirInputEvent const* event);
111 
118 bool mir_input_event_has_cookie(MirInputEvent const* ev);
119 
121 // * Returns the cookie associated with an input event.
122 // *
123 // * \pre The input event must have a MirCookie
124 // * \param [in] ev An input event
125 // * \return The cookie associated with the given input event
126 // * The cookie must be released by calling mir_cookie_release
127 // */
128 //MirCookie const* mir_input_event_get_cookie(MirInputEvent const* ev);
129 
136 MirEvent const* mir_input_event_get_event(MirInputEvent const* event);
137 
144 MirKeyboardAction mir_keyboard_event_action(MirKeyboardEvent const* event);
145 
154 xkb_keysym_t mir_keyboard_event_keysym(MirKeyboardEvent const* event);
155 
159 xkb_keysym_t mir_keyboard_event_key_code(MirKeyboardEvent const* event);
160 
168 int mir_keyboard_event_scan_code(MirKeyboardEvent const* event);
169 
180 char const* mir_keyboard_event_key_text(MirKeyboardEvent const* event);
181 
189 
196 MirInputEvent const* mir_keyboard_event_input_event(MirKeyboardEvent const* event);
197 
205 
213 unsigned int mir_touch_event_point_count(MirTouchEvent const* event);
214 
222 MirTouchId mir_touch_event_id(MirTouchEvent const* event, unsigned int touch_index);
223 
231 MirTouchAction mir_touch_event_action(MirTouchEvent const* event, unsigned int touch_index);
232 
240 MirTouchTooltype mir_touch_event_tooltype(MirTouchEvent const* event, unsigned int touch_index);
241 
242 
251 float mir_touch_event_axis_value(MirTouchEvent const* event, unsigned int touch_index, MirTouchAxis axis);
252 
259 MirInputEvent const* mir_touch_event_input_event(MirTouchEvent const* event);
260 
261 
269 
276 MirPointerAction mir_pointer_event_action(MirPointerEvent const* event);
277 
286 bool mir_pointer_event_button_state(MirPointerEvent const* event,
287  MirPointerButton button);
288 
296 MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const* event);
297 
305 float mir_pointer_event_axis_value(MirPointerEvent const* event,
306  MirPointerAxis axis);
307 
314 MirInputEvent const* mir_pointer_event_input_event(MirPointerEvent const* event);
315 }
316 }
317 
318 #endif //MIRAL_TOOLKIT_EVENT_H_
struct MirEvent MirEvent
Definition: append_event_filter.h:23
MirPointerAction
Possible pointer actions.
Definition: enums.h:149
unsigned int MirPointerButtons
Definition: enums.h:201
MirInputEventType
Definition: enums.h:45
MirEventType
Definition: enums.h:28
MirPointerButton
Definition: enums.h:191
MirKeyboardAction
Possible actions for changing key state.
Definition: enums.h:82
MirTouchAxis
Identifiers for touch axis.
Definition: enums.h:111
MirTouchTooltype
Identifiers for per-touch tool types.
Definition: enums.h:134
MirTouchAction
Possible per touch actions for state changing.
Definition: enums.h:97
MirPointerAxis
Identifiers for pointer axis.
Definition: enums.h:167
unsigned int MirInputEventModifiers
Definition: enums.h:77
MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const *event)
Retreive the pointer button state as a masked set of values.
MirInputEvent const * mir_touch_event_input_event(MirTouchEvent const *event)
Retrieve the corresponding input event.
xkb_keysym_t mir_keyboard_event_key_code(MirKeyboardEvent const *event)
MirInputEventType mir_input_event_get_type(MirInputEvent const *event)
Retrieve the type of an input event.
MirKeyboardEvent const * mir_input_event_get_keyboard_event(MirInputEvent const *event)
Retrieve the MirKeyboardEvent associated with a given input event.
char const * mir_keyboard_event_key_text(MirKeyboardEvent const *event)
Retrieve the text the key press would emit as null terminated utf8 string.
MirInputEventModifiers mir_touch_event_modifiers(MirTouchEvent const *event)
Retrieve the modifier keys pressed when the touch action occured.
MirEvent const * mir_input_event_get_event(MirInputEvent const *event)
‍**
MirTouchAction mir_touch_event_action(MirTouchEvent const *event, unsigned int touch_index)
Retrieve the action which occured for a touch at given index.
bool mir_input_event_has_cookie(MirInputEvent const *ev)
Query if an input event contains a cookie.
int64_t mir_input_event_get_event_time(MirInputEvent const *event)
‍**
MirInputEvent const * mir_pointer_event_input_event(MirPointerEvent const *event)
Retrieve the corresponding input event.
unsigned int mir_touch_event_point_count(MirTouchEvent const *event)
Retrieve the number of touches reported for a given touch event.
MirInputEvent const * mir_keyboard_event_input_event(MirKeyboardEvent const *event)
Retrieve the corresponding input event.
MirInputEventModifiers mir_pointer_event_modifiers(MirPointerEvent const *event)
Retrieve the modifier keys pressed when the pointer action occured.
MirTouchTooltype mir_touch_event_tooltype(MirTouchEvent const *event, unsigned int touch_index)
Retrieve the tooltype for touch at given index.
MirTouchEvent const * mir_input_event_get_touch_event(MirInputEvent const *event)
Retrieve the MirTouchEvent associated with a given input event.
int mir_keyboard_event_scan_code(MirKeyboardEvent const *event)
Retrieve the raw hardware scan code associated with the key acted on.
MirKeyboardAction mir_keyboard_event_action(MirKeyboardEvent const *event)
Retrieve the action which triggered a given key event.
MirPointerEvent const * mir_input_event_get_pointer_event(MirInputEvent const *event)
Retrieve the MirPointerEvent associated with a given input event.
float mir_touch_event_axis_value(MirTouchEvent const *event, unsigned int touch_index, MirTouchAxis axis)
Retrieve the axis value for a given axis on an indexed touch.
MirInputEvent const * mir_event_get_input_event(MirEvent const *event)
Retrieve the MirInputEvent associated with a MirEvent of type mir_event_type_input.
MirPointerAction mir_pointer_event_action(MirPointerEvent const *event)
Retrieve the action which occured to generate a given pointer event.
xkb_keysym_t mir_keyboard_event_keysym(MirKeyboardEvent const *event)
Retrieve the xkb mapped keysym associated with the key acted on.
MirEventType mir_event_get_type(MirEvent const *event)
Retrieves the type of a MirEvent.
float mir_pointer_event_axis_value(MirPointerEvent const *event, MirPointerAxis axis)
Retrieve the axis value reported by a given pointer event.
MirTouchId mir_touch_event_id(MirTouchEvent const *event, unsigned int touch_index)
Retrieve the TouchID for a touch at given index.
MirInputEventModifiers mir_keyboard_event_modifiers(MirKeyboardEvent const *event)
Retrieve the modifier keys pressed when the key action occured.
bool mir_pointer_event_button_state(MirPointerEvent const *event, MirPointerButton button)
Retrieve the state of a given pointer button when the action occurred.
Mir Abstraction Layer.
Definition: floating_window_manager.h:29
int32_t MirTouchId
An identifier for a touch-point.
Definition: toolkit_event.h:28

Copyright © 2012-2022 Canonical Ltd.
Generated on śro, 1 cze 2022, 16:52:55 UTC
This documentation is licensed under the GPL version 2 or 3.