Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
include
client
mir_toolkit
events
input
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
22
#include "
mir_toolkit/events/event.h
"
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
{
37
mir_input_event_type_key
= 0,
38
mir_input_event_type_touch
= 1,
39
mir_input_event_type_pointer
= 2
40
}
MirInputEventType
;
41
45
typedef
enum
{
46
mir_input_event_modifier_none
= 1 << 0,
47
mir_input_event_modifier_alt
= 1 << 1,
48
mir_input_event_modifier_alt_left
= 1 << 2,
49
mir_input_event_modifier_alt_right
= 1 << 3,
50
mir_input_event_modifier_shift
= 1 << 4,
51
mir_input_event_modifier_shift_left
= 1 << 5,
52
mir_input_event_modifier_shift_right
= 1 << 6,
53
mir_input_event_modifier_sym
= 1 << 7,
54
mir_input_event_modifier_function
= 1 << 8,
55
mir_input_event_modifier_ctrl
= 1 << 9,
56
mir_input_event_modifier_ctrl_left
= 1 << 10,
57
mir_input_event_modifier_ctrl_right
= 1 << 11,
58
mir_input_event_modifier_meta
= 1 << 12,
59
mir_input_event_modifier_meta_left
= 1 << 13,
60
mir_input_event_modifier_meta_right
= 1 << 14,
61
mir_input_event_modifier_caps_lock
= 1 << 15,
62
mir_input_event_modifier_num_lock
= 1 << 16,
63
mir_input_event_modifier_scroll_lock
= 1 << 17
64
}
MirInputEventModifier
;
65
typedef
unsigned
int
MirInputEventModifiers
;
66
67
#ifdef __cplusplus
68
}
70
#endif
71
72
#include "
mir_toolkit/events/input/touch_event.h
"
73
#include "
mir_toolkit/events/input/keyboard_event.h
"
74
#include "
mir_toolkit/events/input/pointer_event.h
"
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
*/
90
MirInputDeviceId
mir_input_event_get_device_id
(
MirInputEvent
const
* ev);
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
*/
98
int64_t
mir_input_event_get_event_time
(
MirInputEvent
const
* ev);
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
*/
106
MirInputEventType
mir_input_event_get_type
(
MirInputEvent
const
* ev);
107
108
/*
109
* Retrieve the MirKeyboardEvent associated with a given input event.
110
*
111
* \param[in] event The input event
112
* \return The MirKeyboardEvent or NULL if event type is not
113
* mir_input_event_type_key
114
*/
115
MirKeyboardEvent
const
*
mir_input_event_get_keyboard_event
(
MirInputEvent
const
* ev);
116
117
/*
118
* Retrieve the MirTouchEvent associated with a given input event.
119
*
120
* \param[in] event The input event
121
* \return The MirTouchEvent or NULL if event type is not
122
* mir_input_event_type_touch
123
*/
124
MirTouchEvent
const
*
mir_input_event_get_touch_event
(
MirInputEvent
const
* ev);
125
126
/*
127
* Retrieve the MirPointerEvent associated with a given input event.
128
*
129
* \param[in] event The input event
130
* \return The MirPointerEvent or NULL if event type is not
131
* mir_input_event_type_pointer
132
*/
133
MirPointerEvent
const
*
mir_input_event_get_pointer_event
(
MirInputEvent
const
* ev);
134
135
#ifdef __cplusplus
136
}
138
#endif
139
140
#endif // MIR_TOOLKIT_INPUT_EVENT_H_
pointer_event.h
mir_input_event_modifier_alt
Definition:
input_event.h:47
mir_input_event_modifier_function
Definition:
input_event.h:54
mir_input_event_modifier_shift_left
Definition:
input_event.h:51
keyboard_event.h
MirPointerEvent
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition:
pointer_event.h:35
mir_input_event_modifier_meta
Definition:
input_event.h:58
mir_input_event_get_touch_event
MirTouchEvent const * mir_input_event_get_touch_event(MirInputEvent const *ev)
Definition:
input_event.cpp:246
mir_input_event_modifier_scroll_lock
Definition:
input_event.h:63
mir_input_event_modifier_ctrl_left
Definition:
input_event.h:56
mir_input_event_modifier_alt_right
Definition:
input_event.h:49
mir_input_event_type_pointer
Definition:
input_event.h:39
MirInputEventModifiers
unsigned int MirInputEventModifiers
Definition:
input_event.h:65
mir_input_event_get_device_id
MirInputDeviceId mir_input_event_get_device_id(MirInputEvent const *ev)
Definition:
input_event.cpp:144
MirTouchEvent
struct MirTouchEvent MirTouchEvent
An event type describing a change in touch device state.
Definition:
touch_event.h:33
MirInputEventModifier
MirInputEventModifier
Description of key modifier state.
Definition:
input_event.h:45
MirInputDeviceId
int64_t MirInputDeviceId
Definition:
input_event.h:34
mir_input_event_modifier_none
Definition:
input_event.h:46
mir_input_event_modifier_meta_right
Definition:
input_event.h:60
mir_input_event_get_event_time
int64_t mir_input_event_get_event_time(MirInputEvent const *ev)
Definition:
input_event.cpp:165
mir_input_event_modifier_shift
Definition:
input_event.h:50
mir_input_event_modifier_meta_left
Definition:
input_event.h:59
mir_input_event_modifier_alt_left
Definition:
input_event.h:48
mir_input_event_modifier_shift_right
Definition:
input_event.h:52
MirKeyboardEvent
struct MirKeyboardEvent MirKeyboardEvent
An event type describing a change in keyboard state.
Definition:
keyboard_event.h:44
mir_input_event_get_pointer_event
MirPointerEvent const * mir_input_event_get_pointer_event(MirInputEvent const *ev)
Definition:
input_event.cpp:337
mir_input_event_modifier_ctrl_right
Definition:
input_event.h:57
MirInputEventType
MirInputEventType
Definition:
input_event.h:36
MirInputEvent
struct MirInputEvent MirInputEvent
Definition:
event.h:56
mir_input_event_type_key
Definition:
input_event.h:37
mir_input_event_modifier_caps_lock
Definition:
input_event.h:61
mir_input_event_get_type
MirInputEventType mir_input_event_get_type(MirInputEvent const *ev)
Definition:
input_event.cpp:123
mir_input_event_modifier_num_lock
Definition:
input_event.h:62
mir_input_event_modifier_sym
Definition:
input_event.h:53
mir_input_event_modifier_ctrl
Definition:
input_event.h:55
mir_input_event_get_keyboard_event
MirKeyboardEvent const * mir_input_event_get_keyboard_event(MirInputEvent const *ev)
Definition:
input_event.cpp:202
touch_event.h
event.h
mir_input_event_type_touch
Definition:
input_event.h:38
Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015