Mir
pointer_event.h
Go to the documentation of this file.
1/*
2 * Copyright © 2015 Canonical Ltd.
3 *
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 2 or 3,
6 * as 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 Lesser General Public License for more details.
12 *
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/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */
18
19#ifndef MIR_TOOLKIT_POINTER_EVENT_H_
20#define MIR_TOOLKIT_POINTER_EVENT_H_
21
22#include <stdbool.h>
23
24#ifdef __cplusplus
29extern "C" {
30#endif
31
36
40typedef enum {
41 /* A pointer button has come up */
43 /* A pointer button has gone down */
45 /* The pointer has entered the surface to which this event was delivered */
47 /* The pointer has left the surface to which this event was delivered */
49 /* Axis values have changed for the pointer */
51
54
58typedef enum {
59/* Absolute axis containing the x coordinate of the pointer */
61/* Absolute axis containing the y coordinate of the pointer */
63/* Relative axis containing ticks reported by the vertical scroll wheel */
65/* Relative axis containing ticks reported by the horizontal scroll wheel */
67/* Relative axis containing the last reported x differential from the pointer */
69/* Relative axis containing the last reported y differential from the pointer */
71
74
75/*
76 * Identifiers for pointer buttons
77 */
78typedef enum {
88typedef unsigned int MirPointerButtons;
89
97
105
115 MirPointerButton button);
116
125
134 MirPointerAxis axis);
135
143
144#ifdef __cplusplus
145}
147#endif
148
149#endif /* MIR_TOOLKIT_POINTER_EVENT_H_ */
MirPointerAction
Possible pointer actions.
Definition: pointer_event.h:40
bool mir_pointer_event_button_state(MirPointerEvent const *event, MirPointerButton button)
Retrieve the state of a given pointer button when the action occurred.
unsigned int MirPointerButtons
Definition: pointer_event.h:88
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition: pointer_event.h:35
float mir_pointer_event_axis_value(MirPointerEvent const *event, MirPointerAxis axis)
Retrieve the axis value reported by a given pointer event.
MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const *event)
Retreive the pointer button state as a masked set of values.
MirInputEventModifiers mir_pointer_event_modifiers(MirPointerEvent const *event)
Retrieve the modifier keys pressed when the pointer action occured.
MirInputEvent const * mir_pointer_event_input_event(MirPointerEvent const *event)
Retrieve the corresponding input event.
MirPointerButton
Definition: pointer_event.h:78
MirPointerAction mir_pointer_event_action(MirPointerEvent const *event)
Retrieve the action which occured to generate a given pointer event.
struct MirInputEvent MirInputEvent
Definition: event.h:70
MirPointerAxis
Identifiers for pointer axis.
Definition: pointer_event.h:58
unsigned int MirInputEventModifiers
Definition: input_event.h:67
@ mir_pointer_action_motion
Definition: pointer_event.h:50
@ mir_pointer_actions
Definition: pointer_event.h:52
@ mir_pointer_action_leave
Definition: pointer_event.h:48
@ mir_pointer_action_button_down
Definition: pointer_event.h:44
@ mir_pointer_action_button_up
Definition: pointer_event.h:42
@ mir_pointer_action_enter
Definition: pointer_event.h:46
@ mir_pointer_button_primary
Definition: pointer_event.h:79
@ mir_pointer_button_secondary
Definition: pointer_event.h:80
@ mir_pointer_button_tertiary
Definition: pointer_event.h:81
@ mir_pointer_button_extra
Definition: pointer_event.h:85
@ mir_pointer_button_side
Definition: pointer_event.h:84
@ mir_pointer_button_forward
Definition: pointer_event.h:83
@ mir_pointer_button_task
Definition: pointer_event.h:86
@ mir_pointer_button_back
Definition: pointer_event.h:82
@ mir_pointer_axis_x
Definition: pointer_event.h:60
@ mir_pointer_axes
Definition: pointer_event.h:72
@ mir_pointer_axis_hscroll
Definition: pointer_event.h:66
@ mir_pointer_axis_y
Definition: pointer_event.h:62
@ mir_pointer_axis_relative_y
Definition: pointer_event.h:70
@ mir_pointer_axis_relative_x
Definition: pointer_event.h:68
@ mir_pointer_axis_vscroll
Definition: pointer_event.h:64

Copyright © 2012-2022 Canonical Ltd.
Generated on Sun Oct 9 06:13:38 UTC 2022
This documentation is licensed under the GPL version 2 or 3.