bitfocus / companion-module-vicreo-hotkey

MIT License
13 stars 6 forks source link

Ability to set Mouse Position to variables in companion #70

Closed Smudi97 closed 1 year ago

Smudi97 commented 1 year ago

At the moment I can only enter actual numbers into the "set mouse position" action on companion in order to change the position of the mouse.

I would love to be able to set the mouse position to a variable, specifically to VICREOs own variables for the mouse position. This would enable a specific use case, I often want to set my mouse to a position, click a button and then restore the position the mouse was at before the action. If I could set the mouse position to a variable, I could fetch the position of the mouse before changing it, clicking the button and then restore it to that fetched position via the variables

If there's any confusion about this or anything I can further explain, let me know

JeffreyDavidsz commented 1 year ago

@Smudi97 this is possible at the moment. Just start typing $( and select the right variable. There is a variable for x and y in the module. Those values can be retrieved by using the 'Get the position of the mouse on screen' action

Smudi97 commented 1 year ago

@JeffreyDavidsz Ok so the issue I'm having is user error then, do you have any idea what I'm doing wrong? I've attached a video of my testing. When I press the button that's supposed to put the mouse to the corrdinates stored in the variable, it just puts the mouse to 0 0 and sort of puts a self-reference in the variable. Is that the intended behavior?

https://github.com/bitfocus/companion-module-vicreo-hotkey/assets/58304342/274ea5d5-f454-4ea1-9d47-f42b3089f378

JeffreyDavidsz commented 1 year ago

I notice that te button is still yellow when you press it. try to add 20ms delay into your action. If also updated that now in the preset. There was an other thing that could stop it from working so I've changed that also (all in Companion). new beta will be build

Smudi97 commented 1 year ago

The reason the button is still yellow was because, when I click on the "Test Press" Button, it test presses and immediately moves the mouse according to the button, thus not allowing the "test press" button to be released and, in turn, leaving the streamdeck button pressed. This has no impact whatsoever on the behavior of the variable/function though.

I've shot another video hopefully better showcasing the behavior. The function seemingly doesn't recognize the variable as such and rather intreprets it as just a string and, since it doesn't know what to do with non-number symbols, just sets the mouse position to 0 0.

https://github.com/bitfocus/companion-module-vicreo-hotkey/assets/58304342/f7af2e07-c9d4-4e3b-b5d2-a86aa3f2156f

JeffreyDavidsz commented 1 year ago

Did you test this behavior with Companion 3.0.0?

Smudi97 commented 1 year ago

No, I've only briefly tested the 3.0 beta build, I don't actively use it because it breaks a few workflows of mine due to some bugs it still has

JeffreyDavidsz commented 1 year ago

There is a big change in how this is handled in 3.0.0 I've tested this in the 3.0.0 beta and it works, which bugs are you running into? Because the 3.0.0 is being released as release candidate now