2013-11-27 17:35:26 +08:00
|
|
|
#ifndef INPUT_H
|
|
|
|
#define INPUT_H
|
|
|
|
|
|
|
|
#include "qapi-types.h"
|
|
|
|
|
|
|
|
#define INPUT_EVENT_MASK_KEY (1<<INPUT_EVENT_KIND_KEY)
|
|
|
|
#define INPUT_EVENT_MASK_BTN (1<<INPUT_EVENT_KIND_BTN)
|
|
|
|
#define INPUT_EVENT_MASK_REL (1<<INPUT_EVENT_KIND_REL)
|
|
|
|
#define INPUT_EVENT_MASK_ABS (1<<INPUT_EVENT_KIND_ABS)
|
|
|
|
|
|
|
|
typedef struct QemuInputHandler QemuInputHandler;
|
|
|
|
typedef struct QemuInputHandlerState QemuInputHandlerState;
|
|
|
|
|
|
|
|
typedef void (*QemuInputHandlerEvent)(DeviceState *dev, QemuConsole *src,
|
|
|
|
InputEvent *evt);
|
|
|
|
typedef void (*QemuInputHandlerSync)(DeviceState *dev);
|
|
|
|
|
|
|
|
struct QemuInputHandler {
|
|
|
|
const char *name;
|
|
|
|
uint32_t mask;
|
|
|
|
QemuInputHandlerEvent event;
|
|
|
|
QemuInputHandlerSync sync;
|
|
|
|
};
|
|
|
|
|
|
|
|
QemuInputHandlerState *qemu_input_handler_register(DeviceState *dev,
|
|
|
|
QemuInputHandler *handler);
|
|
|
|
void qemu_input_handler_activate(QemuInputHandlerState *s);
|
|
|
|
void qemu_input_handler_unregister(QemuInputHandlerState *s);
|
|
|
|
void qemu_input_event_send(QemuConsole *src, InputEvent *evt);
|
|
|
|
void qemu_input_event_sync(void);
|
|
|
|
|
2013-11-27 18:38:47 +08:00
|
|
|
InputEvent *qemu_input_event_new_key(KeyValue *key, bool down);
|
|
|
|
void qemu_input_event_send_key(QemuConsole *src, KeyValue *key, bool down);
|
|
|
|
void qemu_input_event_send_key_number(QemuConsole *src, int num, bool down);
|
|
|
|
void qemu_input_event_send_key_qcode(QemuConsole *src, QKeyCode q, bool down);
|
|
|
|
|
2013-11-27 17:35:26 +08:00
|
|
|
#endif /* INPUT_H */
|