winex11.drv: Handle button events without axes.
Not all XInput events contain axes information. In particular, libinput does not seem to provide axes information on button_event. Signed-off-by: John Chadwick <john@jchw.io> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7cc2806e0e
commit
4506b468d4
|
@ -929,13 +929,20 @@ static BOOL button_event( HWND hwnd, XEvent *event )
|
||||||
gMsgPacket.pkTime = EVENT_x11_time_to_win32_time(button->time);
|
gMsgPacket.pkTime = EVENT_x11_time_to_win32_time(button->time);
|
||||||
gMsgPacket.pkSerialNumber = gSerial++;
|
gMsgPacket.pkSerialNumber = gSerial++;
|
||||||
gMsgPacket.pkCursor = curnum;
|
gMsgPacket.pkCursor = curnum;
|
||||||
gMsgPacket.pkX = button->axis_data[0];
|
if (button->axes_count > 0) {
|
||||||
gMsgPacket.pkY = button->axis_data[1];
|
gMsgPacket.pkX = button->axis_data[0];
|
||||||
gMsgPacket.pkOrientation.orAzimuth = figure_deg(button->axis_data[3],button->axis_data[4]);
|
gMsgPacket.pkY = button->axis_data[1];
|
||||||
gMsgPacket.pkOrientation.orAltitude = ((1000 - 15 * max(abs(button->axis_data[3]),
|
gMsgPacket.pkOrientation.orAzimuth = figure_deg(button->axis_data[3],button->axis_data[4]);
|
||||||
abs(button->axis_data[4])))
|
gMsgPacket.pkOrientation.orAltitude = ((1000 - 15 * max(abs(button->axis_data[3]),
|
||||||
* (gMsgPacket.pkStatus & TPS_INVERT?-1:1));
|
abs(button->axis_data[4])))
|
||||||
gMsgPacket.pkNormalPressure = button->axis_data[2];
|
* (gMsgPacket.pkStatus & TPS_INVERT?-1:1));
|
||||||
|
gMsgPacket.pkNormalPressure = button->axis_data[2];
|
||||||
|
} else {
|
||||||
|
gMsgPacket.pkX = last_packet.pkX;
|
||||||
|
gMsgPacket.pkY = last_packet.pkY;
|
||||||
|
gMsgPacket.pkOrientation = last_packet.pkOrientation;
|
||||||
|
gMsgPacket.pkNormalPressure = last_packet.pkNormalPressure;
|
||||||
|
}
|
||||||
gMsgPacket.pkButtons = get_button_state(curnum);
|
gMsgPacket.pkButtons = get_button_state(curnum);
|
||||||
gMsgPacket.pkChanged = get_changed_state(&gMsgPacket);
|
gMsgPacket.pkChanged = get_changed_state(&gMsgPacket);
|
||||||
SendMessageW(hwndTabletDefault,WT_PACKET,gMsgPacket.pkSerialNumber,(LPARAM)hwnd);
|
SendMessageW(hwndTabletDefault,WT_PACKET,gMsgPacket.pkSerialNumber,(LPARAM)hwnd);
|
||||||
|
|
Loading…
Reference in New Issue