aboutsummaryrefslogtreecommitdiffstats
path: root/android/user-events-common.h
blob: 4d02c091057c68e46964034a49e5756361062fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* Copyright (C) 2010 The Android Open Source Project
**
** This software is licensed under the terms of the GNU General Public
** License version 2, as published by the Free Software Foundation, and
** may be copied, distributed, and modified under those terms.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
*/

#ifndef _ANDROID_USER_EVENTS_COMMON_H
#define _ANDROID_USER_EVENTS_COMMON_H

#include "globals.h"

/* Mouse event. */
#define AUSER_EVENT_MOUSE     0
/* Keycode event. */
#define AUSER_EVENT_KEYCODE   1
/* Generic event. */
#define AUSER_EVENT_GENERIC   2

/* Header for user event message sent from UI to the core. */
typedef struct UserEventHeader {
    /* Event type. See AUSER_EVENT_XXX for possible values. */
    uint8_t event_type;
} UserEventHeader;

/* Formats mouse event message (AUSER_EVENT_MOUSE) sent from
 * UI to the core.
 */
typedef struct UserEventMouse {
    int         dx;
    int         dy;
    int         dz;
    unsigned    buttons_state;
} UserEventMouse;

/* Formats keycode event message (AUSER_EVENT_KEYCODE) sent from
 * UI to the core.
 */
typedef struct UserEventKeycode {
    int         keycode;
} UserEventKeycode;

/* Formats generic event message (AUSER_EVENT_GENERIC) sent from
 * UI to the core.
 */
typedef struct UserEventGeneric {
    int         type;
    int         code;
    int         value;
} UserEventGeneric;

#endif /* _ANDROID_USER_EVENTS_COMMON_H */