input-legacy.c (4b59f39bc9a03afcc74b2fa28da7c3189fca507c) | input-legacy.c (7fb1cf1606c78c9d5b538f29176fd5a101726a9d) |
---|---|
1/* 2 * QEMU System Emulator 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 24 unchanged lines hidden (view full) --- 33struct QEMUPutMouseEntry { 34 QEMUPutMouseEvent *qemu_put_mouse_event; 35 void *qemu_put_mouse_event_opaque; 36 int qemu_put_mouse_event_absolute; 37 38 /* new input core */ 39 QemuInputHandler h; 40 QemuInputHandlerState *s; | 1/* 2 * QEMU System Emulator 3 * 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 24 unchanged lines hidden (view full) --- 33struct QEMUPutMouseEntry { 34 QEMUPutMouseEvent *qemu_put_mouse_event; 35 void *qemu_put_mouse_event_opaque; 36 int qemu_put_mouse_event_absolute; 37 38 /* new input core */ 39 QemuInputHandler h; 40 QemuInputHandlerState *s; |
41 int axis[INPUT_AXIS_MAX]; | 41 int axis[INPUT_AXIS__MAX]; |
42 int buttons; 43}; 44 45struct QEMUPutKbdEntry { 46 QEMUPutKBDEvent *put_kbd; 47 void *opaque; 48 QemuInputHandlerState *s; 49}; --- 12 unchanged lines hidden (view full) --- 62 int i; 63 64 for (i = 0; QKeyCode_lookup[i] != NULL; i++) { 65 if (!strcmp(key, QKeyCode_lookup[i])) { 66 break; 67 } 68 } 69 | 42 int buttons; 43}; 44 45struct QEMUPutKbdEntry { 46 QEMUPutKBDEvent *put_kbd; 47 void *opaque; 48 QemuInputHandlerState *s; 49}; --- 12 unchanged lines hidden (view full) --- 62 int i; 63 64 for (i = 0; QKeyCode_lookup[i] != NULL; i++) { 65 if (!strcmp(key, QKeyCode_lookup[i])) { 66 break; 67 } 68 } 69 |
70 /* Return Q_KEY_CODE_MAX if the key is invalid */ | 70 /* Return Q_KEY_CODE__MAX if the key is invalid */ |
71 return i; 72} 73 74static KeyValue *copy_key_value(KeyValue *src) 75{ 76 KeyValue *dst = g_new(KeyValue, 1); 77 memcpy(dst, src, sizeof(*src)); 78 return dst; --- 59 unchanged lines hidden (view full) --- 138 &legacy_kbd_handler); 139 qemu_input_handler_activate(entry->s); 140 return entry; 141} 142 143static void legacy_mouse_event(DeviceState *dev, QemuConsole *src, 144 InputEvent *evt) 145{ | 71 return i; 72} 73 74static KeyValue *copy_key_value(KeyValue *src) 75{ 76 KeyValue *dst = g_new(KeyValue, 1); 77 memcpy(dst, src, sizeof(*src)); 78 return dst; --- 59 unchanged lines hidden (view full) --- 138 &legacy_kbd_handler); 139 qemu_input_handler_activate(entry->s); 140 return entry; 141} 142 143static void legacy_mouse_event(DeviceState *dev, QemuConsole *src, 144 InputEvent *evt) 145{ |
146 static const int bmap[INPUT_BUTTON_MAX] = { | 146 static const int bmap[INPUT_BUTTON__MAX] = { |
147 [INPUT_BUTTON_LEFT] = MOUSE_EVENT_LBUTTON, 148 [INPUT_BUTTON_MIDDLE] = MOUSE_EVENT_MBUTTON, 149 [INPUT_BUTTON_RIGHT] = MOUSE_EVENT_RBUTTON, 150 }; 151 QEMUPutMouseEntry *s = (QEMUPutMouseEntry *)dev; 152 153 switch (evt->type) { 154 case INPUT_EVENT_KIND_BTN: --- 112 unchanged lines hidden --- | 147 [INPUT_BUTTON_LEFT] = MOUSE_EVENT_LBUTTON, 148 [INPUT_BUTTON_MIDDLE] = MOUSE_EVENT_MBUTTON, 149 [INPUT_BUTTON_RIGHT] = MOUSE_EVENT_RBUTTON, 150 }; 151 QEMUPutMouseEntry *s = (QEMUPutMouseEntry *)dev; 152 153 switch (evt->type) { 154 case INPUT_EVENT_KIND_BTN: --- 112 unchanged lines hidden --- |