summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXTest.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXTest.c')
-rw-r--r--macosx/tkMacOSXTest.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c
index cefcfad..9faeff8 100644
--- a/macosx/tkMacOSXTest.c
+++ b/macosx/tkMacOSXTest.c
@@ -175,9 +175,11 @@ TkTestLogDisplay(
* PressButtonObjCmd --
*
* This Tcl command simulates a button press at a specific screen
- * location. It injects NSEvents into the NSApplication event queue,
- * as opposed to adding events to the Tcl queue as event generate
- * would do. One application is for testing the grab command.
+ * location. It injects NSEvents into the NSApplication event queue, as
+ * opposed to adding events to the Tcl queue as event generate would do.
+ * One application is for testing the grab command. These events have
+ * pressure = -1.0 as a signal indicating that they should not be ignored
+ * by [NSApp tkProcessMouseEvent].
*
* Results:
* A standard Tcl result.
@@ -229,7 +231,7 @@ PressButtonObjCmd(
pt.x = loc.x = x;
pt.y = y;
loc.y = ScreenHeight - y;
- wNum = -1;
+ wNum = 0;
CGWarpMouseCursorPosition(pt);
motion = [NSEvent mouseEventWithType:NSMouseMoved
location:loc
@@ -239,7 +241,7 @@ PressButtonObjCmd(
context:nil
eventNumber:0
clickCount:1
- pressure:0.0];
+ pressure:-1.0];
[NSApp postEvent:motion atStart:NO];
press = [NSEvent mouseEventWithType:NSLeftMouseDown
location:loc
@@ -249,7 +251,7 @@ PressButtonObjCmd(
context:nil
eventNumber:1
clickCount:1
- pressure:0.0];
+ pressure:-1.0];
[NSApp postEvent:press atStart:NO];
release = [NSEvent mouseEventWithType:NSLeftMouseUp
location:loc
@@ -259,7 +261,7 @@ PressButtonObjCmd(
context:nil
eventNumber:2
clickCount:1
- pressure:0.0];
+ pressure:-1.0];
[NSApp postEvent:release atStart:NO];
return TCL_OK;
}