aboutsummaryrefslogtreecommitdiffstats
path: root/user-events-ui.c
blob: f295ade80e14e331de2facd1de6a6b944f24e681 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* 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.
*/
#include "user-events.h"
#include "android/utils/debug.h"
#include "console.h"
#include <stdio.h>

void
user_event_keycodes(int *kcodes, int count)
{
    int nn;
    for (nn = 0; nn < count; nn++)
        user_event_keycode(kcodes[nn]);
}

void
user_event_keycode(int  kcode)
{
#if 0 /* TODO */
    kbd_put_keycode(kcode);
#endif
}

void
user_event_key(unsigned code, unsigned down)
{
    if(code == 0) {
        return;
    }
    if (VERBOSE_CHECK(keys))
        printf(">> KEY [0x%03x,%s]\n", (code & 0x1ff), down ? "down" : " up " );

    user_event_keycode((code & 0x1ff) | (down ? 0x200 : 0));
}


void
user_event_mouse(int dx, int dy, int dz, unsigned buttons_state)
{
#if 0 /* TODO */
    kbd_mouse_event(dx, dy, dz, buttons_state);
#endif
}

#if 0
static QEMUPutGenericEvent *generic_event_callback;
static void*                generic_event_opaque;
#endif

void  user_event_register_generic(void* opaque, QEMUPutGenericEvent *callback)
{
#if 0 /* TODO */
    generic_event_callback = callback;
    generic_event_opaque   = opaque;
#endif
}

void
user_event_generic(int type, int code, int value)
{
#if 0 /* TODO */
    if (generic_event_callback)
        generic_event_callback(generic_event_opaque, type, code, value);
#endif
}