Mir
input_event.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 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_INPUT_EVENT_H_
20 #define MIR_TOOLKIT_INPUT_EVENT_H_
21 
23 
24 #include <stdint.h>
25 
26 #ifdef __cplusplus
27 
31 extern "C" {
32 #endif
33 
34 typedef int64_t MirInputDeviceId;
35 
36 typedef enum {
41 
45 typedef enum {
65 typedef unsigned int MirInputEventModifiers;
66 
67 #ifdef __cplusplus
68 }
70 #endif
71 
75 
76 #ifdef __cplusplus
77 
81 extern "C" {
82 #endif
83 
84 /*
85  * Retrieves the device id responsible for generating an input event.
86  *
87  * \param [in] event The input event
88  * \return The id of the generating device
89  */
91 
92 /*
93  * Retrieve the time at which an input event occured.
94  *
95  * \param [in] event The input event
96  * \return A timestamp in nanoseconds-since-epoch
97  */
99 
100 /*
101  * Retrieve the type of an input event (e.g. key, touch...)
102  *
103  * \param [in] event The input event
104  * \return The input event type
105  */
107 
108 /*
109  * Retrieve the MirKeyInputEvent associated with a given input event.
110  *
111  * \param[in] event The input event
112  * \return The MirKeyInputEvent or NULL if event type is not
113  * mir_input_event_type_key
114  */
116 
117 /*
118  * Retrieve the MirTouchInputEvent associated with a given input event.
119  *
120  * \param[in] event The input event
121  * \return The MirTouchInputEvent or NULL if event type is not
122  * mir_input_event_type_touch
123  */
125 
126 /*
127  * Retrieve the MirPointerInputEvent associated with a given input event.
128  *
129  * \param[in] event The input event
130  * \return The MirPointerInputEvent or NULL if event type is not
131  * mir_input_event_type_pointer
132  */
134 
135 #ifdef __cplusplus
136 }
138 #endif
139 
140 #endif // MIR_TOOLKIT_INPUT_EVENT_H_
Definition: input_event.h:47
Definition: input_event.h:54
Definition: input_event.h:51
struct MirKeyInputEvent MirKeyInputEvent
An event type describing a change in keyboard state.
Definition: key_input_event.h:35
Definition: input_event.h:58
Definition: input_event.h:63
Definition: input_event.h:56
struct MirTouchInputEvent MirTouchInputEvent
An event type describing a change in touch device state.
Definition: touch_input_event.h:33
Definition: input_event.h:49
Definition: input_event.h:39
unsigned int MirInputEventModifiers
Definition: input_event.h:65
MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const *ev)
Definition: input_event.cpp:155
MirTouchInputEvent const * mir_input_event_get_touch_input_event(MirInputEvent const *ev)
Definition: input_event.cpp:304
MirInputEventModifier
Description of key modifier state.
Definition: input_event.h:45
int64_t MirInputDeviceId
Definition: input_event.h:34
MirPointerInputEvent const * mir_input_event_get_pointer_input_event(MirInputEvent const *ev)
Definition: input_event.cpp:440
Definition: input_event.h:46
Definition: input_event.h:60
int64_t mir_input_event_get_event_time(MirInputEvent const *ev)
Definition: input_event.cpp:176
Definition: input_event.h:50
Definition: input_event.h:59
Definition: input_event.h:48
Definition: input_event.h:52
MirKeyInputEvent const * mir_input_event_get_key_input_event(MirInputEvent const *ev)
Definition: input_event.cpp:198
Definition: input_event.h:57
MirInputEventType
Definition: input_event.h:36
struct MirInputEvent MirInputEvent
Definition: event.h:53
Definition: input_event.h:37
Definition: input_event.h:61
MirInputEventType mir_input_event_get_type(MirInputEvent const *ev)
Definition: input_event.cpp:134
Definition: input_event.h:62
Definition: input_event.h:53
struct MirPointerInputEvent MirPointerInputEvent
An event type describing a change in pointer device state.
Definition: pointer_input_event.h:35
Definition: input_event.h:55
Definition: input_event.h:38

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015