Ubuntu Platform API  2.5.0
A library helping with tight integration into the Ubuntu platform
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
event_deprecated.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
5  * it under the terms of the GNU Lesser General Public License version 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 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: Thomas Voß <thomas.voss@canonical.com>
17  */
18 
19 #ifndef UBUNTU_APPLICATION_UI__EVENT_DEPRECATED_H_
20 #define UBUNTU_APPLICATION_UI__EVENT_DEPRECATED_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
27  typedef enum
28  {
32  } EventType;
33 
35  typedef struct
36  {
38  int32_t device_id;
39  int32_t source_id;
40  int32_t action;
41  int32_t flags;
42  int32_t meta_state;
43 
44  union
45  {
47  struct HardwareSwitchEvent
48  {
50  uint32_t policy_flags;
51  int32_t switch_code;
52  int32_t switch_value;
53  } hw_switch;
55  struct KeyEvent
56  {
57  int32_t key_code;
58  int32_t scan_code;
59  int32_t repeat_count;
63  } key;
68  struct MotionEvent
69  {
70  int32_t edge_flags;
71  int32_t button_state;
72  float x_offset;
73  float y_offset;
74  float x_precision;
75  float y_precision;
78  size_t pointer_count;
80  } motion;
81  } details;
82  } Event;
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif // UBUNTU_APPLICATION_UI__EVENT_DEPRECATED_H_
float y_offset
Movement in y direction since down event.
size_t pointer_count
Number of pointers reported in this event.
int32_t key_code
int32_t button_state
State of buttons of the device.
Event originates from something moving, e.g., a wheel, a mouse, a finger on a touchpad.
#define UBUNTU_APPLICATION_UI_INPUT_EVENT_MAX_POINTER_COUNT
Definition: event.h:108
EventType
int32_t flags
Flags associated with this event.
int32_t switch_value
The value reported by the switch.
nsecs_t event_time
Timestamp that marks when this event happened.
Definition: event.h:180
nsecs_t down_time
Timestamp that marks the down event.
Definition: event.h:179
int32_t repeat_count
int32_t action
Action signalled by this event.
float x_precision
Sampling precision in x direction.
int is_system_key
nsecs_t event_time
Definition: event.h:143
int32_t scan_code
int32_t meta_state
State of the meta modifiers (ALT, CTRL, SHIFT).
uint32_t policy_flags
Policy flags.
int32_t edge_flags
Set for touches intersecting a touchscreen's edges, requires HW support.
float x_offset
Movement in x direction since down event.
Event originates from an additional button attached to the device's HW, e.g., power button...
nsecs_t event_time
Timestamp when the event happened.
float y_precision
Sampling precision in y direction.
EventType type
Type of the event.
struct PointerCoordinate pointer_coordinates[UBUNTU_APPLICATION_UI_INPUT_EVENT_MAX_POINTER_COUNT]
Pointer information, valid from [0,pointer_count).
Definition: event.h:182
int32_t switch_code
The scan code of the switch.
int32_t source_id
Source that this event originated from.
Event originates from a keyboard.
int64_t nsecs_t
Definition: event.h:111
nsecs_t down_time
Timestamp that marks the down event.
int32_t device_id
Device that this event originated from.