It appears that the mechanics of the Front End prevent TouchPosition from working as expected. My plan is to keep track of the position of the second touch using TouchPosition["Graphics",2] in the code below. The user would make a first touch on the graph, then write on it with the second touch. However, when I make the second touch and move it, then the zoom factor of the Front End changes, instead of the second touch being tracked. How can I actually track the second touch? By the way, I am using Windows 10 on a Surface laptop.

Code in question:

mymouse := Block[{}, pos = TouchPosition["Graphics",2];
  If[pos =!= None, AppendTo[posList, pos];
   posList = DeleteDuplicates@posList;]]
posList = {};
Dynamic[Graphics[Line@posList, Frame -> True, ImageSize -> Medium, 
  PlotRange -> {{0, 6}, {0, 4}}]]

By contrast, this code works as expected if instead of tracking touch, I track the mouse with pos=MousePosition["Graphics"];.

  • 3
    $\begingroup$ What system are you using? (I can't help probably, since I don't have a touchscreen, but it might be important.) $\endgroup$
    – Michael E2
    Commented Jun 8, 2022 at 16:52

1 Answer 1


TouchPosition and GestureHandler are only supported in Wolfram Player on iOS.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.