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  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIRAL_TOOLKIT_EVENT_H_
20 #define MIRAL_TOOLKIT_EVENT_H_
21 
23 
24 #include <xkbcommon/xkbcommon.h>
25 
26 struct MirEvent;
27 struct MirKeyboardEvent;
28 struct MirTouchEvent;
29 struct MirPointerEvent;
30 struct MirInputEvent;
31 
37 typedef int32_t MirTouchId;
38 
39 namespace miral
40 {
41 namespace toolkit
42 {
52 
62 
64 // * Retrieves the device id responsible for generating an input event.
65 // *
66 // * \param [in] event The input event
67 // * \return The id of the generating device
68 // */
69 //MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const* event);
70 
78 
86 
95 
104 
113 
121 
123 // * Returns the cookie associated with an input event.
124 // *
125 // * \pre The input event must have a MirCookie
126 // * \param [in] ev An input event
127 // * \return The cookie associated with the given input event
128 // * The cookie must be released by calling mir_cookie_release
129 // */
130 //MirCookie const* mir_input_event_get_cookie(MirInputEvent const* ev);
131 
139 
147 
156 
165 
177 
185 
193 
201 
209 unsigned int mir_touch_event_point_count(MirTouchEvent const* event);
210 
218 MirTouchId mir_touch_event_id(MirTouchEvent const* event, unsigned int touch_index);
219 
227 MirTouchAction mir_touch_event_action(MirTouchEvent const* event, unsigned int touch_index);
228 
236 MirTouchTooltype mir_touch_event_tooltype(MirTouchEvent const* event, unsigned int touch_index);
237 
238 
247 float mir_touch_event_axis_value(MirTouchEvent const* event, unsigned int touch_index, MirTouchAxis axis);
248 
256 
257 
265 
273 
283  MirPointerButton button);
284 
293 
302  MirPointerAxis axis);
303 
311 }
312 }
313 
314 #endif //MIRAL_TOOLKIT_EVENT_H_
MirPointerAction
Possible pointer actions.
Definition: enums.h:160
unsigned int MirPointerButtons
Definition: enums.h:208
MirInputEventType
Definition: enums.h:57
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition: pointer_event.h:35
int32_t MirTouchId
An identifier for a touch-point.
Definition: touch_event.h:40
MirEventType
Definition: enums.h:34
struct MirKeyboardEvent MirKeyboardEvent
An event type describing a change in keyboard state.
Definition: keyboard_event.h:41
MirPointerButton
Definition: enums.h:198
MirKeyboardAction
Possible actions for changing key state.
Definition: enums.h:93
struct MirInputEvent MirInputEvent
Definition: event.h:42
MirTouchAxis
Identifiers for touch axis.
Definition: enums.h:122
struct MirEvent MirEvent
Definition: event.h:50
MirTouchTooltype
Identifiers for per-touch tool types.
Definition: enums.h:145
MirTouchAction
Possible per touch actions for state changing.
Definition: enums.h:108
MirPointerAxis
Identifiers for pointer axis.
Definition: enums.h:178
struct MirTouchEvent MirTouchEvent
An event type describing a change in touch device state.
Definition: touch_event.h:33
unsigned int MirInputEventModifiers
Definition: enums.h:88
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)
Retrieve the xkb mapped keycode associated with the key acted on.
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.
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:31
int32_t MirTouchId
An identifier for a touch-point.
Definition: toolkit_event.h:30

Copyright © 2012-2021 Canonical Ltd.
Generated on Mon Jul 5 13:30:06 UTC 2021
This documentation is licensed under the GPL version 2 or 3.