mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
input: add core bits of the new input layer
Register and unregister handlers. Event dispatcher code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
8b6b0c59a6
commit
c8b405b679
3 changed files with 116 additions and 1 deletions
32
include/ui/input.h
Normal file
32
include/ui/input.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
#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);
|
||||
|
||||
#endif /* INPUT_H */
|
Loading…
Add table
Add a link
Reference in a new issue