Which action to jump mouse cursor to 2nd screen (and back)?

Can't find it in the forum already, or I find similar questions without answers like Detect which monitor the cursor is on and use that to decide which to move to

I want to have a trackpad action to jump the mouse cursor to the middle of the ipad (sidecar), and another one to jump back to main screen with last cursor position (save cursor position). I do NOT want to use "move cursor to position", because this might causes errors in the future, if I change the screen to another side etc.

Sorry, if this was already solved.