@@ -47,9 +47,9 @@
#define cgrect(nsrect) (*(CGRect *)&(nsrect))
#define COCOA_MOUSE_EVENT \
if (isTabletEnabled) { \
- kbd_mouse_event((int)(p.x * 0x7FFF / (screen.width - 1)), (int)((screen.height - p.y) * 0x7FFF / (screen.height - 1)), 0, buttons); \
+ kbd_mouse_event((int)(p.x * 0x7FFF / (screen.width - 1)), (int)((screen.height - p.y) * 0x7FFF / (screen.height - 1)), 0, 0, buttons); \
} else if (isMouseGrabed) { \
- kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, buttons); \
+ kbd_mouse_event((int)[event deltaX], (int)[event deltaY], 0, 0, buttons); \
} else { \
[NSApp sendEvent:event]; \
}
@@ -649,7 +649,7 @@ static int cocoa_keycode_to_qemu(int keycode)
break;
case NSScrollWheel:
if (isTabletEnabled || isMouseGrabed) {
- kbd_mouse_event(0, 0, -[event deltaY], 0);
+ kbd_mouse_event(0, 0, -[event deltaY], 0, 0);
} else {
[NSApp sendEvent:event];
}
@@ -21,7 +21,7 @@
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 void QEMUPutMouseEvent(void *opaque, int dx, int dy, int dz, int dw, int buttons_state);
typedef struct QEMUPutMouseEntry {
QEMUPutMouseEvent *qemu_put_mouse_event;
@@ -53,7 +53,7 @@ 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);
+void kbd_mouse_event(int dx, int dy, int dz, int dw, int buttons_state);
/* Does the current mouse generate absolute events */
int kbd_mouse_is_absolute(void);
@@ -318,7 +318,8 @@ typedef struct MouseState {
} MouseState;
static void adb_mouse_event(void *opaque,
- int dx1, int dy1, int dz1, int buttons_state)
+ int dx1, int dy1, int dz1, int dw1,
+ int buttons_state)
{
ADBDevice *d = opaque;
MouseState *s = d->opaque;
@@ -86,7 +86,7 @@ static uint32_t ads7846_transfer(SSISlave *dev, uint32_t value)
}
static void ads7846_ts_event(void *opaque,
- int x, int y, int z, int buttons_state)
+ int x, int y, int z, int w, int buttons_state)
{
ADS7846State *s = opaque;
@@ -827,7 +827,8 @@ static void handle_kbd_command(ChannelState *s, int val)
}
static void sunmouse_event(void *opaque,
- int dx, int dy, int dz, int buttons_state)
+ int dx, int dy, int dz, int dw,
+ int buttons_state)
{
ChannelState *s = opaque;
int ch;
@@ -31,7 +31,7 @@
#define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6)
static void msmouse_event(void *opaque,
- int dx, int dy, int dz, int buttons_state)
+ int dx, int dy, int dz, int dw, int buttons_state)
{
CharDriverState *chr = (CharDriverState *)opaque;
@@ -330,7 +330,7 @@ static void ps2_mouse_send_packet(PS2MouseState *s)
}
static void ps2_mouse_event(void *opaque,
- int dx, int dy, int dz, int buttons_state)
+ int dx, int dy, int dz, int dw, int buttons_state)
{
PS2MouseState *s = opaque;
@@ -361,7 +361,7 @@ static void ps2_mouse_event(void *opaque,
void ps2_mouse_fake_event(void *opaque)
{
- ps2_mouse_event(opaque, 1, 0, 0, 0);
+ ps2_mouse_event(opaque, 1, 0, 0, 0, 0);
}
void ps2_write_mouse(void *opaque, int val)
@@ -122,7 +122,7 @@ static CPUWriteMemoryFunc * const syborg_pointer_writefn[] = {
syborg_pointer_write
};
-static void syborg_pointer_event(void *opaque, int dx, int dy, int dz,
+static void syborg_pointer_event(void *opaque, int dx, int dy, int dz, int dw,
int buttons_state)
{
SyborgPointerState *s = (SyborgPointerState *)opaque;
@@ -412,7 +412,7 @@ static void tsc2005_timer_tick(void *opaque)
}
static void tsc2005_touchscreen_event(void *opaque,
- int x, int y, int z, int buttons_state)
+ int x, int y, int z, int dw, int buttons_state)
{
TSC2005State *s = opaque;
int p = s->pressure;
@@ -968,7 +968,7 @@ static void tsc210x_timer_tick(void *opaque)
}
static void tsc210x_touchscreen_event(void *opaque,
- int x, int y, int z, int buttons_state)
+ int x, int y, int z, int w, int buttons_state)
{
TSC210xState *s = opaque;
int p = s->pressure;
@@ -414,7 +414,8 @@ static void usb_hid_changed(USBHIDState *hs)
}
static void usb_mouse_event(void *opaque,
- int dx1, int dy1, int dz1, int buttons_state)
+ int dx1, int dy1, int dz1, int dw1,
+ int buttons_state)
{
USBHIDState *hs = opaque;
USBMouseState *s = &hs->ptr;
@@ -428,7 +429,7 @@ static void usb_mouse_event(void *opaque,
}
static void usb_tablet_event(void *opaque,
- int x, int y, int dz, int buttons_state)
+ int x, int y, int dz, int dw, int buttons_state)
{
USBHIDState *hs = opaque;
USBMouseState *s = &hs->ptr;
@@ -119,7 +119,8 @@ static const uint8_t qemu_wacom_config_descriptor[] = {
};
static void usb_mouse_event(void *opaque,
- int dx1, int dy1, int dz1, int buttons_state)
+ int dx1, int dy1, int dz1, int dw1,
+ int buttons_state)
{
USBWacomState *s = opaque;
@@ -131,7 +132,7 @@ static void usb_mouse_event(void *opaque,
}
static void usb_wacom_event(void *opaque,
- int x, int y, int dz, int buttons_state)
+ int x, int y, int dz, int dw, int buttons_state)
{
USBWacomState *s = opaque;
@@ -67,7 +67,8 @@ static uint32_t vmmouse_get_status(VMMouseState *s)
return (s->status << 16) | s->nb_queue;
}
-static void vmmouse_mouse_event(void *opaque, int x, int y, int dz, int buttons_state)
+static void vmmouse_mouse_event(void *opaque, int x, int y, int dz, int dw,
+ int buttons_state)
{
VMMouseState *s = opaque;
int buttons = 0;
@@ -320,7 +320,7 @@ static void xenfb_key_event(void *opaque, int scancode)
* the button state.
*/
static void xenfb_mouse_event(void *opaque,
- int dx, int dy, int dz, int button_state)
+ int dx, int dy, int dz, int dz2, int button_state)
{
struct XenInput *xenfb = opaque;
int dw = ds_get_width(xenfb->c.ds);
@@ -137,7 +137,7 @@ void kbd_put_ledstate(int ledstate)
}
}
-void kbd_mouse_event(int dx, int dy, int dz, int buttons_state)
+void kbd_mouse_event(int dx, int dy, int dz, int dw, int buttons_state)
{
QEMUPutMouseEntry *entry;
QEMUPutMouseEvent *mouse_event;
@@ -160,10 +160,10 @@ void kbd_mouse_event(int dx, int dy, int dz, int buttons_state)
else
width = graphic_width - 1;
mouse_event(mouse_event_opaque,
- width - dy, dx, dz, buttons_state);
+ width - dy, dx, dz, dw, buttons_state);
} else
mouse_event(mouse_event_opaque,
- dx, dy, dz, buttons_state);
+ dx, dy, dz, dw, buttons_state);
}
}
@@ -1841,14 +1841,14 @@ static void do_mouse_move(Monitor *mon, const QDict *qdict)
dz = 0;
if (dz_str)
dz = strtol(dz_str, NULL, 0);
- kbd_mouse_event(dx, dy, dz, mouse_button_state);
+ kbd_mouse_event(dx, dy, dz, 0, mouse_button_state);
}
static void do_mouse_button(Monitor *mon, const QDict *qdict)
{
int button_state = qdict_get_int(qdict, "button_state");
mouse_button_state = button_state;
- kbd_mouse_event(0, 0, 0, mouse_button_state);
+ kbd_mouse_event(0, 0, 0, 0, mouse_button_state);
}
static void do_ioport_read(Monitor *mon, const QDict *qdict)
@@ -503,7 +503,8 @@ static void sdl_mouse_mode_change(Notifier *notify)
}
}
-static void sdl_send_mouse_event(int dx, int dy, int dz, int x, int y, int state)
+static void sdl_send_mouse_event(int dx, int dy, int dz, int dw,
+ int x, int y, int state)
{
int buttons;
buttons = 0;
@@ -526,7 +527,7 @@ static void sdl_send_mouse_event(int dx, int dy, int dz, int x, int y, int state
dy = y;
}
- kbd_mouse_event(dx, dy, dz, buttons);
+ kbd_mouse_event(dx, dy, dz, dw, buttons);
}
static void toggle_full_screen(DisplayState *ds)
@@ -684,7 +685,7 @@ static void sdl_refresh(DisplayState *ds)
case SDL_MOUSEMOTION:
if (gui_grab || kbd_mouse_is_absolute() ||
absolute_enabled) {
- sdl_send_mouse_event(ev->motion.xrel, ev->motion.yrel, 0,
+ sdl_send_mouse_event(ev->motion.xrel, ev->motion.yrel, 0, 0,
ev->motion.x, ev->motion.y, ev->motion.state);
}
break;
@@ -713,7 +714,8 @@ static void sdl_refresh(DisplayState *ds)
dz = 1;
}
#endif
- sdl_send_mouse_event(0, 0, dz, bev->x, bev->y, buttonstate);
+ sdl_send_mouse_event(0, 0, dz, 0, bev->x, bev->y,
+ buttonstate);
}
}
break;
@@ -1292,17 +1292,17 @@ static void pointer_event(VncState *vs, int button_mask, int x, int y)
x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000,
ds_get_height(vs->ds) > 1 ?
y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000,
- dz, buttons);
+ dz, 0, buttons);
} else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) {
x -= 0x7FFF;
y -= 0x7FFF;
- kbd_mouse_event(x, y, dz, buttons);
+ kbd_mouse_event(x, y, dz, 0, buttons);
} else {
if (vs->last_x != -1)
kbd_mouse_event(x - vs->last_x,
y - vs->last_y,
- dz, buttons);
+ dz, 0, buttons);
vs->last_x = x;
vs->last_y = y;
}
Add a parameter for the hwheel delta to QEMUPutMouseEntry and kbd_mouse_event, and adjust all users of those to match. At the moment, all calls to kbd_mouse_event will pass 0 for the delta. Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net> --- cocoa.m | 6 +++--- console.h | 4 ++-- hw/adb.c | 3 ++- hw/ads7846.c | 2 +- hw/escc.c | 3 ++- hw/msmouse.c | 2 +- hw/ps2.c | 4 ++-- hw/syborg_pointer.c | 2 +- hw/tsc2005.c | 2 +- hw/tsc210x.c | 2 +- hw/usb-hid.c | 5 +++-- hw/usb-wacom.c | 5 +++-- hw/vmmouse.c | 3 ++- hw/xenfb.c | 2 +- input.c | 6 +++--- monitor.c | 4 ++-- sdl.c | 10 ++++++---- vnc.c | 6 +++--- 18 files changed, 39 insertions(+), 32 deletions(-)