input: fixes for the rewrite.

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTHbURAAoJEEy22O7T6HE4xRcP/1JMzgSf9tHZiTcHa1kjvshS
 frG3kowPkAm5PmCe02VniYRqcez9ZT5LbEEUvmG8fn6/54Vnjgiz8+oEFllpEeO5
 Y3eU/7uxeXfLSFMXmUJNPQUd4XQJbIq8zHZODsrng27rNH76HZsb5vZaT1ReWq4k
 ozpx3ZAGemKfEsl96xKRwkTw0HnTajH3P2mRYpFodhsAPqB8pH/y2g9ZIEjk/MgG
 QO3bHS0KQpFSF0nFO76JGCLEcH1AjIChNbkIQfYuB64LwS6wXqxGv8kymvrc0DL8
 Mgp0dktpUgWumSB+kjaRePfVCEqY+IbAIo1v4o9skU89szYaB/Byf6eDtLl3TRnE
 6SWOjElkZ7qpgPsBUBFO2oX//YFdC36LpBH7ZcOr7vSm2MjI2BLa87n/wh+lhbTf
 oydWnLY++0zp0F76t+kYZYn/l5LY2/aTN5XF3xGnFvKVyb+lnAbjPHB/LI/0RNHY
 cEzhgiuDdsu/L6NgQJMcO+U+3d7GSNkBkFdRg7llD45UGzp+zQ0dwjq4+gIQYK5u
 UMrByfgpVX5TSMYdC2+CWWEGEGeGcoaly+otV6CE4G341h/BCWlY5Cg+0c2WQoKp
 BXuFkzsNnZxS0t4UQvZP+IeV+PUJf97e389sFVNd/YE+Fajy0Z2BVfRFSxJgfS+L
 8Y6pSJJzvWju67+9aQbX
 =YfEB
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-5' into staging

input: fixes for the rewrite.

# gpg: Signature made Mon 10 Mar 2014 12:50:25 GMT using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-input-5:
  input: map INPUT_BUTTON_WHEEL_{UP,DOWN} to legacy input z axis moves.
  input: sdl: fix guest_cursor logic.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2014-03-11 12:52:08 +00:00
commit c57ec3249e
2 changed files with 25 additions and 7 deletions

View File

@ -359,6 +359,20 @@ static void legacy_mouse_event(DeviceState *dev, QemuConsole *src,
} else { } else {
s->buttons &= ~bmap[evt->btn->button]; s->buttons &= ~bmap[evt->btn->button];
} }
if (evt->btn->down && evt->btn->button == INPUT_BUTTON_WHEEL_UP) {
s->qemu_put_mouse_event(s->qemu_put_mouse_event_opaque,
s->axis[INPUT_AXIS_X],
s->axis[INPUT_AXIS_Y],
-1,
s->buttons);
}
if (evt->btn->down && evt->btn->button == INPUT_BUTTON_WHEEL_DOWN) {
s->qemu_put_mouse_event(s->qemu_put_mouse_event_opaque,
s->axis[INPUT_AXIS_X],
s->axis[INPUT_AXIS_Y],
1,
s->buttons);
}
break; break;
case INPUT_EVENT_KIND_ABS: case INPUT_EVENT_KIND_ABS:
s->axis[evt->abs->axis] = evt->abs->value; s->axis[evt->abs->axis] = evt->abs->value;

View File

@ -455,13 +455,17 @@ static void sdl_send_mouse_event(int dx, int dy, int x, int y, int state)
real_screen->w); real_screen->w);
qemu_input_queue_abs(dcl->con, INPUT_AXIS_Y, y, qemu_input_queue_abs(dcl->con, INPUT_AXIS_Y, y,
real_screen->h); real_screen->h);
} else if (guest_cursor) { } else {
x -= guest_x; if (guest_cursor) {
y -= guest_y; x -= guest_x;
guest_x += x; y -= guest_y;
guest_y += y; guest_x += x;
qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, x); guest_y += y;
qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, y); dx = x;
dy = y;
}
qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, dx);
qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, dy);
} }
qemu_input_event_sync(); qemu_input_event_sync();
} }