Home › Forums › Software Development › Gaze detection on WPF Button
- This topic has 1 reply, 2 voices, and was last updated 2 years, 11 months ago by Grant [Tobii].
- 03/04/2020 at 15:14 #14088GrublixxParticipant
Hi. I’m starting with tobii. I want to create a custom button. When the user gaze for 5 seconds, the program clicks on it.
I get the .xaml aspect
<Setter Property=”Background” Value=”White” />
<Trigger Property=”tobii:Behaviors.HasGaze” Value=”True”>
<Setter Property=”Background” Value=”Magenta” />
But still struggle with the backend. I think that i have to use “_greetingInteractor.WithGazeAware().HasGaze(onGazeEnters).LostGaze(onGazeLeaves);” , but i don’t get know how to make it work in my context.
Thank for the help05/04/2020 at 20:35 #14095Grant [Tobii]Keymaster
Hi @grublixx and thanks for your query. You are quite close with the XAML structure however a few additional components remain to make the button not only gaze aware but to launch a procedure when receiving gaze input.
You will be pleased to know that we have created an article for this purpose within the Core SDK documentation and samples package which you can download @ https://github.com/tobiitech/core-sdk-docs
Specifically, if you navigate to /docs/articles/wpf.html we explain under the ‘activatable behaviour’ section, the proper methodology to correctly set up an WPF gaze aware interactor.
For your case, it will be necessary to create a custom timer routine to enable dwell activation, but the syntax will remain the same.
Hopefully, this is exactly what you are looking for! Please do go through our tutorial and let us know if we can provide any further information or assistance for your project. Best Wishes.
- You must be logged in to reply to this topic.