Mir
Loading...
Searching...
No Matches
toolkit_event.h
Go to the documentation of this file.
1/*
2 * Copyright © 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
24struct MirEvent;
25struct MirKeyboardEvent;
26struct MirTouchEvent;
27struct MirPointerEvent;
28struct MirInputEvent;
29
35typedef int32_t MirTouchId;
36
37namespace miral
38{
39namespace toolkit
40{
50
59MirInputEvent 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
75int64_t mir_input_event_get_event_time(MirInputEvent const* event);
76
83MirInputEventType mir_input_event_get_type(MirInputEvent const* event);
84
92MirKeyboardEvent const* mir_input_event_get_keyboard_event(MirInputEvent const* event);
93
101MirTouchEvent const* mir_input_event_get_touch_event(MirInputEvent const* event);
102
110MirPointerEvent const* mir_input_event_get_pointer_event(MirInputEvent const* event);
111
118bool 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
136MirEvent const* mir_input_event_get_event(MirInputEvent const* event);
137
144MirKeyboardAction mir_keyboard_event_action(MirKeyboardEvent const* event);
145
154xkb_keysym_t mir_keyboard_event_keysym(MirKeyboardEvent const* event);
155
159xkb_keysym_t mir_keyboard_event_key_code(MirKeyboardEvent const* event);
160
168int mir_keyboard_event_scan_code(MirKeyboardEvent const* event);
169
180char const* mir_keyboard_event_key_text(MirKeyboardEvent const* event);
181
189
196MirInputEvent const* mir_keyboard_event_input_event(MirKeyboardEvent const* event);
197
205
213unsigned int mir_touch_event_point_count(MirTouchEvent const* event);
214
222MirTouchId mir_touch_event_id(MirTouchEvent const* event, unsigned int touch_index);
223
231MirTouchAction mir_touch_event_action(MirTouchEvent const* event, unsigned int touch_index);
232
240MirTouchTooltype mir_touch_event_tooltype(MirTouchEvent const* event, unsigned int touch_index);
241
242
251float mir_touch_event_axis_value(MirTouchEvent const* event, unsigned int touch_index, MirTouchAxis axis);
252
259MirInputEvent const* mir_touch_event_input_event(MirTouchEvent const* event);
260
261
269
276MirPointerAction mir_pointer_event_action(MirPointerEvent const* event);
277
286bool mir_pointer_event_button_state(MirPointerEvent const* event,
287 MirPointerButton button);
288
296MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const* event);
297
305float mir_pointer_event_axis_value(MirPointerEvent const* event,
306 MirPointerAxis axis);
307
314MirInputEvent 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:151
unsigned int MirPointerButtons
Definition enums.h:209
MirInputEventType
Definition enums.h:45
MirEventType
Definition enums.h:28
MirPointerButton
Definition enums.h:199
MirKeyboardAction
Possible actions for changing key state.
Definition enums.h:82
MirTouchAxis
Identifiers for touch axis.
Definition enums.h:113
MirTouchTooltype
Identifiers for per-touch tool types.
Definition enums.h:136
MirTouchAction
Possible per touch actions for state changing.
Definition enums.h:99
MirPointerAxis
Identifiers for pointer axis.
Definition enums.h:169
unsigned int MirInputEventModifiers
Definition enums.h:77
MirKeyboardEvent const * mir_input_event_get_keyboard_event(MirInputEvent const *event)
Retrieve the MirKeyboardEvent associated with a given input event.
MirInputEvent const * mir_pointer_event_input_event(MirPointerEvent const *event)
Retrieve the corresponding input event.
MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const *event)
Retreive the pointer button state as a masked set of values.
MirInputEvent const * mir_event_get_input_event(MirEvent const *event)
Retrieve the MirInputEvent associated with a MirEvent of type mir_event_type_input.
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.
MirInputEventModifiers mir_touch_event_modifiers(MirTouchEvent const *event)
Retrieve the modifier keys pressed when the touch action occured.
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.
MirEvent const * mir_input_event_get_event(MirInputEvent const *event)
‍**
int64_t mir_input_event_get_event_time(MirInputEvent const *event)
‍**
unsigned int mir_touch_event_point_count(MirTouchEvent const *event)
Retrieve the number of touches reported for a given touch event.
MirPointerEvent const * mir_input_event_get_pointer_event(MirInputEvent const *event)
Retrieve the MirPointerEvent associated with a given 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.
char const * mir_keyboard_event_key_text(MirKeyboardEvent const *event)
Retrieve the text the key press would emit as null terminated utf8 string.
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.
MirTouchEvent const * mir_input_event_get_touch_event(MirInputEvent const *event)
Retrieve the MirTouchEvent 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_keyboard_event_input_event(MirKeyboardEvent const *event)
Retrieve the corresponding input event.
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.
MirInputEvent const * mir_touch_event_input_event(MirTouchEvent const *event)
Retrieve the corresponding input event.
Mir Abstraction Layer.
Definition floating_window_manager.h:29
int32_t MirTouchId
An identifier for a touch-point.
Definition toolkit_event.h:35

Copyright © 2012-2024 Canonical Ltd.
Generated on Sat Aug 17 07:04:01 UTC 2024
This documentation is licensed under the GPL version 2 or 3.