Remembering mouse position and jumping to it?

Scr1pter

2016-06-20 10:26:56

Hello,

My M-Audio Oxygen has 9 track buttons which are normally used for mute/unmute.
I use them for other things and additionally I created a translator that moves the mouse cursor to the highlighted track.
For track 1 it goes to 356x220, for track 2 it goes to 356x260 and so on.
(For each track button an extra translator.)
This works without problems.

Now my question is if this mouse cursor position can be saved temporarily.
I ask because there are also other buttons which do different things like opening an Instrument editor,
activating an Arpeggiator etc.
For such a function the mouse cursor must be moved again.
However, I want the mouse cursor gets moved to the track again, by retrieving the saved mouse position.
(After the function was activated - so at the end it the cursor should return)

My concrete idea would be:
01. Press track button
02. Mouse cursor gets moved to track
03. Mouse cursor position gets saved
04. Another button gets pressed, whose function is activating Arpeggiator
05. Mouse cursor gets moved to another position
06. At the end of the function the saved mouse cursor gets retrieved
07. Mouse cursor jumps back to the highlighted track

For example in Logitech Lua this is possible by using the function "GetMousePosition".
There you write for example:
01. x, y = GetMousePosition()
02. You move the cursor manually or by a function, e.g. MoveMouseTo(1000, 800)
03. Later the mouse cursor gets moved to the saved position with MoveMouseTo(x, y)

Maybe something similar is possible in MTS too?
Probably the cursor position can get sent to a variable which gets read afterwards?

Best regards

Scr1pter

2016-06-20 11:36:53

I think I have already found the solution.

I tried it with keystrokes (don't have a MIDI device here at the moment.)
In my test I created 1 preset with 5 translators.
Translator 1 till 3 (Numlock 1 till 3) have a fixed mouse position.
I defined the fixed mouse position in the rule window:
zq=100
zr=600
(Translator 2 and 3 have different values of course)

For Translator 4 (Numlock 0) I chose a normal X/Y mouse position.
Translator 5 (Numlock 0) has zq in X and zr with Y and a delay of 1 second (as test).
When pressing either Numlock 1 or 2 or 3 and then Numlock 0, it jumps back to the last mouse cursor.

Sounds like a solution to me.

florian

2016-07-04 14:39:22

sounds good!