void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry);
void kbd_put_keycode(int keycode);
-#ifdef CONFIG_MARU
-void qemu_add_ps2kbd_event_handler(QEMUPutKBDEvent *func, void *opaque);
-void qemu_remove_ps2kbd_event_handler(void);
-void ps2kbd_put_keycode(int keycode);
-#endif
void kbd_put_ledstate(int ledstate);
void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
s->common.update_arg = update_arg;
s->scancode_set = 2;
vmstate_register(NULL, 0, &vmstate_ps2_keyboard, s);
-#ifdef CONFIG_MARU
- qemu_add_ps2kbd_event_handler(ps2_put_keycode, s);
-#else
qemu_add_kbd_event_handler(ps2_put_keycode, s);
-#endif
qemu_register_reset(ps2_kbd_reset, s);
return s;
}
static QEMUPutKBDEvent *qemu_put_kbd_event;
static void *qemu_put_kbd_event_opaque;
-#ifdef CONFIG_MARU
-static QEMUPutKBDEvent *qemu_put_ps2kbd_event;
-static void *qemu_put_ps2kbd_event_opaque;
-#endif
static QTAILQ_HEAD(, QEMUPutLEDEntry) led_handlers = QTAILQ_HEAD_INITIALIZER(led_handlers);
static QTAILQ_HEAD(, QEMUPutMouseEntry) mouse_handlers =
QTAILQ_HEAD_INITIALIZER(mouse_handlers);
qemu_put_kbd_event = NULL;
}
-#ifdef CONFIG_MARU
-/* use ps2kbd device as a hardkey device. */
-void qemu_add_ps2kbd_event_handler(QEMUPutKBDEvent *func, void *opaque)
-{
- qemu_put_ps2kbd_event_opaque = opaque;
- qemu_put_ps2kbd_event = func;
-}
-
-void qemu_remove_ps2kbd_event_handler(void)
-{
- qemu_put_ps2kbd_event_opaque = NULL;
- qemu_put_ps2kbd_event = NULL;
-}
-
-void ps2kbd_put_keycode(int keycode)
-{
- if (qemu_put_ps2kbd_event) {
- qemu_put_ps2kbd_event(qemu_put_ps2kbd_event_opaque, keycode);
- }
-}
-#endif
-
static void check_mode_change(void)
{
static int current_is_absolute, current_has_absolute;
QTAILQ_FOREACH(entry, &mouse_handlers, node) {
/* if mouse event is wheelup ,wheeldown or move
then go to ps2 mouse event(index == 0) */
- if((buttons_state > 3 && entry->index == 0)) {
+ if (buttons_state > 3 && entry->index == 0) {
//INFO("input device: %s, event: %d\n", entry->qemu_put_mouse_event_name, buttons_state);
buttons_state = 0;
mouse_event = entry->qemu_put_mouse_event;
}
}
/* other events(mouse up, down and drag), go to touch screen */
- if(!entry) {
+ if (!entry) {
entry = QTAILQ_FIRST(&mouse_handlers);
mouse_event = entry->qemu_put_mouse_event;
mouse_event_opaque = entry->qemu_put_mouse_event_opaque;
/*
* mainloop_evhandle.c
*
- * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
* Kitae Kim <kt920.kim@samsung.com>
#define MLOOP_EVTYPE_USB_DEL 2
#define MLOOP_EVTYPE_INTR_UP 3
#define MLOOP_EVTYPE_INTR_DOWN 4
-#define MLOOP_EVTYPE_HWKEY 5
#define MLOOP_EVTYPE_TOUCH 6
#define MLOOP_EVTYPE_KEYBOARD 7
#define MLOOP_EVTYPE_KBD_ADD 8
qemu_irq_lower((qemu_irq)data);
}
-static void mloop_evhandle_hwkey(struct mloop_evpack* pack)
-{
- int event_type = 0;
- int keycode = 0;
-
- memcpy(&event_type, pack->data, sizeof(int));
- memcpy(&keycode, pack->data + sizeof(int), sizeof(int));
-
- if (KEY_PRESSED == event_type) {
- if (kbd_mouse_is_absolute()) {
- ps2kbd_put_keycode(keycode & 0x7f);
- }
- } else if (KEY_RELEASED == event_type) {
- if (kbd_mouse_is_absolute()) {
- ps2kbd_put_keycode(keycode | 0x80);
- }
- } else {
- ERR("Unknown hardkey event type.[event_type:%d, keycode:%d]\n",
- event_type, keycode);
- }
-}
-
static void mloop_evhandle_touch(struct mloop_evpack* pack)
{
maru_virtio_touchscreen_notify();
case MLOOP_EVTYPE_INTR_DOWN:
mloop_evhandle_intr_down(*(long*)&pack.data[0]);
break;
- case MLOOP_EVTYPE_HWKEY:
- mloop_evhandle_hwkey(&pack);
- break;
case MLOOP_EVTYPE_TOUCH:
mloop_evhandle_touch(&pack);
break;
usbdisk = (USBDevice *)dev;
}
-void mloop_evcmd_hwkey(int event_type, int keycode)
-{
- struct mloop_evpack pack;
-
- pack.type = MLOOP_EVTYPE_HWKEY;
- pack.size = 5 + 8; //TODO: ?
-
- memcpy(pack.data, &event_type, sizeof(int));
- memcpy(pack.data + sizeof(int), &keycode, sizeof(int));
-
- mloop_evsock_send(&mloop, &pack);
-}
-
void mloop_evcmd_touch(void)
{
struct mloop_evpack pack;
/*
* mainloop_evhandle.c
*
- * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact:
* Kitae Kim <kt920.kim@samsung.com>
void mloop_evcmd_raise_intr(void *irq);
void mloop_evcmd_lower_intr(void *irq);
-void mloop_evcmd_hwkey(int event_type, int keycode);
void mloop_evcmd_touch(void);
void mloop_evcmd_keyboard(void *data);
void mloop_evcmd_ramdump(void);