summaryrefslogtreecommitdiff
path: root/console.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-02-26 17:17:36 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-09 08:47:20 -0600
commit03a23a85f4c2588778d7d58ae49e5521d79d1b06 (patch)
tree385546624ed9fc33795991574dff6c1791f61b19 /console.h
parent32bb404a6a4d726dfd691f75704f08257ce65ffe (diff)
kbd leds: infrastructure
Adds infrastructure for keyboard led status tracking to qemu. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'console.h')
-rw-r--r--console.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/console.h b/console.h
index 916859d5b..71e8ff230 100644
--- a/console.h
+++ b/console.h
@@ -10,10 +10,16 @@
#define MOUSE_EVENT_RBUTTON 0x02
#define MOUSE_EVENT_MBUTTON 0x04
+/* identical to the ps/2 keyboard bits */
+#define QEMU_SCROLL_LOCK_LED (1 << 0)
+#define QEMU_NUM_LOCK_LED (1 << 1)
+#define QEMU_CAPS_LOCK_LED (1 << 2)
+
/* in ms */
#define GUI_REFRESH_INTERVAL 30
typedef void QEMUPutKBDEvent(void *opaque, int keycode);
+typedef void QEMUPutLEDEvent(void *opaque, int ledstate);
typedef void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int buttons_state);
typedef struct QEMUPutMouseEntry {
@@ -26,13 +32,22 @@ typedef struct QEMUPutMouseEntry {
struct QEMUPutMouseEntry *next;
} QEMUPutMouseEntry;
+typedef struct QEMUPutLEDEntry {
+ QEMUPutLEDEvent *put_led;
+ void *opaque;
+ QTAILQ_ENTRY(QEMUPutLEDEntry) next;
+} QEMUPutLEDEntry;
+
void qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque);
QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
void *opaque, int absolute,
const char *name);
void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry);
+QEMUPutLEDEntry *qemu_add_led_event_handler(QEMUPutLEDEvent *func, void *opaque);
+void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry);
void kbd_put_keycode(int keycode);
+void kbd_put_ledstate(int ledstate);
void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
int kbd_mouse_is_absolute(void);