Menu

#2740 event generate -warp 1 doesn't work on Mac OSX Aqua

closed-fixed
69. Events (88)
5
2010-01-06
2010-01-06
No

In the Aqua build of Tk, warping the pointer doesn't work in either 8.5.8 or 8.6b1. SImple script to reproduce:

package require Tk
bind . <1> { puts "Yes"; event generate . <Motion> -warp 1 -x 5 -y 5 }

in X11/MacOS, this warps the pointer as expected when clicking anywhere in the main window. This functionality is needed e.g. for a 3D game, where the pointer is hidden and only the motion is tracked.

Discussion

  • Donal K. Fellows

    • labels: --> 69. Events
    • assigned_to: nobody --> das
     
  • Donal K. Fellows

    • status: open --> closed-fixed
     
  • Donal K. Fellows

    Fixed for HEAD. It's a bit of an intrusive fix though (needed a change to the global TkDisplay structure) so I'm not going to backport. (DAS: if you want to backport, note that you want CGPostMouseEvent and not CGWarpMouseCursorPosition; odd things happen if you use the wrong one.)