XQuartz: Fixed proper processing of tablet button presses
(cherry picked from commit ca0babafa4e9cf1b67ec460655bffe569ac9c3e9)
This commit is contained in:
parent
b70a8ba3dc
commit
de4936d748
|
@ -861,6 +861,7 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
||||||
tilt_y = 0;
|
tilt_y = 0;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto check_subtype;
|
||||||
case NSLeftMouseDown: ev_button=1; ev_type=ButtonPress; goto check_subtype;
|
case NSLeftMouseDown: ev_button=1; ev_type=ButtonPress; goto check_subtype;
|
||||||
case NSOtherMouseDown: ev_button=2; ev_type=ButtonPress; goto check_subtype;
|
case NSOtherMouseDown: ev_button=2; ev_type=ButtonPress; goto check_subtype;
|
||||||
case NSRightMouseDown: ev_button=3; ev_type=ButtonPress; goto check_subtype;
|
case NSRightMouseDown: ev_button=3; ev_type=ButtonPress; goto check_subtype;
|
||||||
|
@ -872,16 +873,16 @@ static void send_nsevent (NSEventType type, NSEvent *e) {
|
||||||
case NSRightMouseDragged: ev_button=3; ev_type=MotionNotify; goto check_subtype;
|
case NSRightMouseDragged: ev_button=3; ev_type=MotionNotify; goto check_subtype;
|
||||||
|
|
||||||
check_subtype:
|
check_subtype:
|
||||||
if ([e subtype] != NSTabletPointEventSubtype) goto handle_mouse;
|
if ([e subtype] != NSTabletPointEventSubtype)
|
||||||
|
goto handle_mouse;
|
||||||
// fall through to get tablet data
|
// fall through to get tablet data
|
||||||
case NSTabletPoint:
|
case NSTabletPoint:
|
||||||
pressure = [e pressure];
|
pressure = [e pressure];
|
||||||
tilt_x = [e tilt].x;
|
tilt_x = [e tilt].x;
|
||||||
tilt_y = [e tilt].y;
|
tilt_y = [e tilt].y;
|
||||||
|
goto handle_mouse;
|
||||||
// fall through to normal mouse handling
|
// fall through to normal mouse handling
|
||||||
|
|
||||||
case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse;
|
|
||||||
|
|
||||||
handle_mouse:
|
handle_mouse:
|
||||||
DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y,
|
DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y,
|
||||||
pressure, tilt_x, tilt_y);
|
pressure, tilt_x, tilt_y);
|
||||||
|
|
Loading…
Reference in New Issue