Home Forums Software Development InteractionLib WPF: HasGaze including children?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #18578
    Roman
    Participant

    I’m using InteractionLib WPF with C#. To detect the gaze on a particular element I use HasGazeChanged event and element.GetHasGaze(). It works great, but GetHasGaze() returns false when the gaze is in a child element.

    E.g. I want the whole Grid to do stuff when the gaze enters and leaves it, regardless of which elements inside the grid the user is looking at. And at the same time those elements inside also do their stuff in response to the user gaze.

    Is there a nice way to know if my Grid has gaze in itself or in any of its child elements? I could also call GetHasGaze() for each child, but this approach feels a bit ugly. Looking for a more elegant approach.

    #18585
    Roman
    Participant

    Ok, while waiting for a response here, I implemented the ugly approach of calling every child’s GetHasGaze(). Turns out that when gaze moves from one child to another child within the parent, the parent’s HasGazeChanged event is called multiple times (leaving one child, entering the other one), and on leaving the first child no one actually has the gaze. Even though the actual gaze is still within one parent, moving from one child to another child, there are moments when the parent and the children all return false on GetHasGaze().

    While this is logically incorrect (because my gaze is still inside, someone must have it), I’m having a strong feeling that my whole approach is wrong. Can anyone advise? My goal is to (at the same time):
    1) detect when gaze enters/leaves the parent, including the children (gaze in a child means gaze in the parent as well);
    2) detect when gaze enters/leaves each child

    #18589
    Roman
    Participant

    As an option, is it possible to ignore short losses of gaze? For example if I could set it to ignore losses of gaze e.g. 200 ms or shorter, it would be helpful. This short loss of gaze may often be misleading. For example, if the user blinks, the gaze is lost for a short moment. But the actual attention of the user hasn’t left the target, so it’s misleading to process that as a loss of gaze.

    I couldn’t find anything related to this in the docs, so I assume such feature is not implemented, is it? @grant-rogers may be you can advise on these matters?

    #18590
    Roman
    Participant

    Ok I hacked it manually. Maybe not the most elegant solution, but I just want to keep moving with my project. I did like this:
    1. To check if the parent has gaze, I check both the parent’s GetHasGaze() and each child’s GetHasGaze().
    2. To ignore short-term gaze losses (like when gaze moves from one child to another within the parent, or when just blinking) I moved the logic from the HasGazeChanged handler to a timer callback, starting the timer at HasGazeChanged to execute after 200ms, if the gaze is not regained.

    #18598
    Grant [Tobii]
    Keymaster

    Hi @sapp, apologies for the delay in replying.. unfortunately, most of the specialist are currently on vacation this month so it’s been tricky trying to get you a definitive answer. It seems however that you have a workaround in the time being. I will of course keep you apprised once I have further feedback for you, thanks.

    #18607
    Grant [Tobii]
    Keymaster

    Hi @sapp, we managed to create a simple test application here to investigate the issue: a grid, two children (buttons), all three are gaze aware and have HasGazeChanged event subscriptions where every event is logged and every GetHasGaze for every control. we tried it with both buttons having some space between them and also with buttons being aligned side-by-side together.

    We were not able to reproduce the issue you mentioned unfortunately.. we did not manage to get a situation when the gaze is moving between controls, HasGazeChanged invokes and all controls return false on GetHasGaze.

    Accordingly, it would be great if we could get to reproduce it. Is it possible for you to provide us with a simple example application and/or instructions of how to reproduce the behaviour?

    Regarding the short loss of gaze, this is mentioned in the documentation @ https://tobiitechnology.github.io/TobiiCoreSDK/articles/wpf.html

    <Grid x:Name="LayoutRoot"
          tobii:Behaviors.IsGazeAware="True"
          tobii:Behaviors.GazeAwareMode="Delayed"
          tobii:Behaviors.GazeAwareDelayTime="1000">
            ...
        </Grid.Style>
    </Grid>

    Try to adjust this value and let us know how you get on. Best Wishes.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.