Screen location based trigger

Hi all, I need some help with a trigger I’m trying to create. I have a circle on screen whose coordinates is driven by a depth camera via local network triggers. The coordinates track to the right hand location that the depth cam and skeleton tracking (NUITrack) software is tracking. So basically the circle acts like a cursor that follows your hand movements.

What I would like to do is trigger a button when I hover over it with the cursor. I make this trigger work by making the circle container “free” and using the “is dragged over” trigger but it only works when I move the circle with the mouse. If the circle is moved over by the coordinate stream mentioned above, I get nothing. I’ve also tried the the 'is or has been manipulated triggers" but have the same issue. It seems most of these triggers are based on movement by the mouse and only the mouse.

Any tricky ways to make this work?

Hi @emphelp

One way to go could be to use Timer Trigger with Conditional Triggers based on coordinates.

If I put it in words, it will be something like:

  • IF 1 sec has elapsed (Repeat indefinitely)
    • AND Circle X coordinate > value1
    • AND Circle X coordinate < value2
    • AND Circle Y coordinate > value3
    • AND Circle Y coordinate < value4
  • THEN Simulate a tap on Button

By doing this, every second (or less/more, you pick the time), coordinates X and Y of your circle will be evaluated, and if they meet the conditions (values 1 to 4 being describing the surface limits of button), then button will be pressed.

In your Composer, it will look like this:

If you check the video in this OpenVINO thread, that’s the method we use, starting at 00:17"



Cool, thanks. This did end up working in the long run. Thing is that I had tried this before and it failed. It turns out that the reason it failed the first time was that instead of hard coding the button area like you did, I was trying to make it dynamic by binding the locations in the condition to the coordinates of the button itself. I did this, for example, but binding to the X coordinate of the button and then using a value converter to add or subtract 1/2 the width of the button in order to get the sides defined. Looking again at the “Result” field of the converter was blank so there seems to be a bug in there somehwhere (I will enter a bug report).

Anyhoo, after changing it to hard code the button edge coordinates all is working.

1 Like