Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
include
common
mir_toolkit
events
input
pointer_input_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 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_INPUT_EVENT_H_
20
#define MIR_TOOLKIT_POINTER_INPUT_EVENT_H_
21
22
#include <stdbool.h>
23
24
#ifdef __cplusplus
25
29
extern
"C"
{
30
#endif
31
35
typedef
struct
MirPointerInputEvent
MirPointerInputEvent
;
36
40
typedef
enum
{
41
/* A pointer button has come up */
42
mir_pointer_input_event_action_button_up
= 0,
43
/* A pointer button has gone down */
44
mir_pointer_input_event_action_button_down
= 1,
45
/* The pointer has entered the surface to which this event was delivered */
46
mir_pointer_input_event_action_enter
= 2,
47
/* The pointer has left the surface to which this event was delivered */
48
mir_pointer_input_event_action_leave
= 3,
49
/* Axis values have changed for the pointer */
50
mir_pointer_input_event_action_motion
= 4
51
}
MirPointerInputEventAction
;
52
56
typedef
enum
{
57
/* Absolute axis containing the x coordinate of the pointer */
58
mir_pointer_input_axis_x
= 0,
59
/* Absolute axis containing the y coordinate of the pointer */
60
mir_pointer_input_axis_y
= 1,
61
/* Relative axis containing ticks reported by the vertical scroll wheel */
62
mir_pointer_input_axis_vscroll
= 2,
63
/* Relative axis containing ticks reported by the horizontal scroll wheel */
64
mir_pointer_input_axis_hscroll
= 3
65
}
MirPointerInputEventAxis
;
66
67
/*
68
* Identifiers for pointer buttons
69
*/
70
typedef
enum
{
71
mir_pointer_input_button_primary
= 1,
72
mir_pointer_input_button_secondary
= 2,
73
mir_pointer_input_button_tertiary
= 3,
74
mir_pointer_input_button_back
= 4,
75
mir_pointer_input_button_forward
= 5
76
}
MirPointerInputEventButton
;
77
84
MirInputEventModifiers
mir_pointer_input_event_get_modifiers
(
MirPointerInputEvent
const
* event);
85
92
MirPointerInputEventAction
mir_pointer_input_event_get_action
(
MirPointerInputEvent
const
* event);
93
102
bool
mir_pointer_input_event_get_button_state
(
MirPointerInputEvent
const
* event,
103
MirPointerInputEventButton
button);
104
112
float
mir_pointer_input_event_get_axis_value
(
MirPointerInputEvent
const
* event,
113
MirPointerInputEventAxis
axis);
114
115
#ifdef __cplusplus
116
}
118
#endif
119
120
#endif
/* MIR_TOOLKIT_POINTER_INPUT_EVENT_H_ */
mir_pointer_input_axis_x
Definition:
pointer_input_event.h:58
mir_pointer_input_event_action_motion
Definition:
pointer_input_event.h:50
mir_pointer_input_event_action_enter
Definition:
pointer_input_event.h:46
mir_pointer_input_button_secondary
Definition:
pointer_input_event.h:72
mir_pointer_input_axis_vscroll
Definition:
pointer_input_event.h:62
mir_pointer_input_button_forward
Definition:
pointer_input_event.h:75
mir_pointer_input_button_tertiary
Definition:
pointer_input_event.h:73
mir_pointer_input_event_get_axis_value
float mir_pointer_input_event_get_axis_value(MirPointerInputEvent const *event, MirPointerInputEventAxis axis)
Retrieve the axis value reported by a given pointer event.
Definition:
input_event.cpp:503
mir_pointer_input_axis_y
Definition:
pointer_input_event.h:60
mir_pointer_input_button_back
Definition:
pointer_input_event.h:74
mir_pointer_input_event_get_modifiers
MirInputEventModifiers mir_pointer_input_event_get_modifiers(MirPointerInputEvent const *event)
Retrieve the modifier keys pressed when the pointer action occured.
Definition:
input_event.cpp:452
mir_pointer_input_event_get_action
MirPointerInputEventAction mir_pointer_input_event_get_action(MirPointerInputEvent const *event)
Retrieve the action which occured to generate a given pointer event.
Definition:
input_event.cpp:458
MirInputEventModifiers
unsigned int MirInputEventModifiers
Definition:
input_event.h:65
MirPointerInputEventButton
MirPointerInputEventButton
Definition:
pointer_input_event.h:70
mir_pointer_input_event_action_button_up
Definition:
pointer_input_event.h:42
mir_pointer_input_event_action_leave
Definition:
pointer_input_event.h:48
mir_pointer_input_event_get_button_state
bool mir_pointer_input_event_get_button_state(MirPointerInputEvent const *event, MirPointerInputEventButton button)
Retrieve the state of a given pointer button when the action occurred.
Definition:
input_event.cpp:482
MirPointerInputEventAxis
MirPointerInputEventAxis
Identifiers for pointer axis.
Definition:
pointer_input_event.h:56
mir_pointer_input_event_action_button_down
Definition:
pointer_input_event.h:44
MirPointerInputEvent
struct MirPointerInputEvent MirPointerInputEvent
An event type describing a change in pointer device state.
Definition:
pointer_input_event.h:35
MirPointerInputEventAction
MirPointerInputEventAction
Possible pointer actions.
Definition:
pointer_input_event.h:40
mir_pointer_input_axis_hscroll
Definition:
pointer_input_event.h:64
mir_pointer_input_button_primary
Definition:
pointer_input_event.h:71
Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015