@@ -109,9 +109,13 @@ static void hid_pointer_event(DeviceState *dev,
QemuConsole *src,
InputEvent *evt)
{
static const int bmap[INPUT_BUTTON__MAX] = {
- [INPUT_BUTTON_LEFT] = 0x01,
- [INPUT_BUTTON_RIGHT] = 0x02,
- [INPUT_BUTTON_MIDDLE] = 0x04,
+ [INPUT_BUTTON_LEFT] = 0x01,
+ [INPUT_BUTTON_RIGHT] = 0x02,
+ [INPUT_BUTTON_MIDDLE] = 0x04,
+ [INPUT_BUTTON_WHELLLEFT] = 0x??, /* FIXME! */
+ [INPUT_BUTTON_WHELLRIGHT] = 0x??, /* FIXME! */
+ [INPUT_BUTTON_FN1] = 0x??, /* FIXME! */
+ [INPUT_BUTTON_FN2] = 0x??, /* FIXME! */
};
HIDState *hs = (HIDState *)dev;
HIDPointerEvent *e;
@@ -383,9 +383,13 @@ static void ps2_mouse_event(DeviceState *dev,
QemuConsole *src,
InputEvent *evt)
{
static const int bmap[INPUT_BUTTON__MAX] = {
- [INPUT_BUTTON_LEFT] = MOUSE_EVENT_LBUTTON,
- [INPUT_BUTTON_MIDDLE] = MOUSE_EVENT_MBUTTON,
- [INPUT_BUTTON_RIGHT] = MOUSE_EVENT_RBUTTON,
+ [INPUT_BUTTON_LEFT] = MOUSE_EVENT_LBUTTON,
+ [INPUT_BUTTON_MIDDLE] = MOUSE_EVENT_MBUTTON,
+ [INPUT_BUTTON_RIGHT] = MOUSE_EVENT_RBUTTON,
+ [INPUT_BUTTON_WHELLLEFT] = MOUSE_EVENT_WLBUTTON,
+ [INPUT_BUTTON_WHELLRIGHT] = MOUSE_EVENT_WRRBUTTON,
+ [INPUT_BUTTON_FN1] = MOUSE_EVENT_FN1BUTTON,
+ [INPUT_BUTTON_FN2] = MOUSE_EVENT_FN2BUTTON,
};
PS2MouseState *s = (PS2MouseState *)dev;
@@ -144,6 +144,10 @@ static const unsigned int
keymap_button[INPUT_BUTTON__MAX] = {
[INPUT_BUTTON_MIDDLE] = BTN_MIDDLE,
[INPUT_BUTTON_WHEELUP] = BTN_GEAR_UP,
[INPUT_BUTTON_WHEELDOWN] = BTN_GEAR_DOWN,
+ [INPUT_BUTTON_WHELLLEFT] = BTN_GEAR_LEFT,
+ [INPUT_BUTTON_WHELLRIGHT] = BTN_GEAR_RIGHT,
+ [INPUT_BUTTON_FN1] = BTN_FUNCTION_1,
+ [INPUT_BUTTON_FN2] = BTN_FUNCTION_2,
};
static const unsigned int axismap_rel[INPUT_AXIS__MAX] = {
b/include/standard-headers/linux/input-event-codes.h
@@ -416,6 +416,11 @@
#define BTN_WHEEL 0x150
#define BTN_GEAR_DOWN 0x150
#define BTN_GEAR_UP 0x151
+#define BTN_GEAR_LEFT 0x??? /* FIXME! */
+#define BTN_GEAR_RIGHT 0x??? /* FIXME! */
+#define BTN_FUNCTION_1 0x??? /* FIXME! */
+#define BTN_FUNCTION_2 0x??? /* FIXME! */
+
#define KEY_OK 0x160
#define KEY_SELECT 0x161
@@ -1390,6 +1390,10 @@ static void hmp_mouse_button(Monitor *mon,
const QDict *qdict)
[INPUT_BUTTON_LEFT] = MOUSE_EVENT_LBUTTON,
[INPUT_BUTTON_MIDDLE] = MOUSE_EVENT_MBUTTON,
[INPUT_BUTTON_RIGHT] = MOUSE_EVENT_RBUTTON,
+ [INPUT_BUTTON_WHELLLEFT] = MOUSE_EVENT_WLBUTTON,
+ [INPUT_BUTTON_WHELLRIGHT] = MOUSE_EVENT_WRRBUTTON,
+ [INPUT_BUTTON_FN1] = MOUSE_EVENT_FN1BUTTON,
+ [INPUT_BUTTON_FN2] = MOUSE_EVENT_FN2BUTTON,
};
int button_state = qdict_get_int(qdict, "button_state");
@@ -212,6 +212,17 @@ static void input_linux_event_mouse(void *opaque)
case BTN_GEAR_DOWN:
qemu_input_queue_btn(NULL, INPUT_BUTTON_WHEELDOWN,
event.value);
+ case BTN_GEAR_LEFT:
+ qemu_input_queue_btn(NULL, INPUT_BUTTON_WHELLLEFT,
+ event.value);
+ case BTN_GEAR_RIGHT:
+ qemu_input_queue_btn(NULL, INPUT_BUTTON_WHELLRIGHT,
+ event.value);
+ case BTN_FUNCTION_1:
+ qemu_input_queue_btn(NULL, INPUT_BUTTON_FN1, event.value);
+ break;
+ case BTN_FUNCTION_1:
+ qemu_input_queue_btn(NULL, INPUT_BUTTON_FN2, event.value);
break;
};
break;