Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

GazeElement StateChanged not working on TextBox? #3100

Closed

Description

@niels9001

Describe the bug

It's not clear to me on what controls the StateChanged event should work - in the documentations, some button controls are mentioned. However, when applied on a TextBox nothing works - which is strange to me.
I'd expect that any control would have a GazeElement StateChanged event trigged (e.g. the user's gaze enters a TextBox). The docs should be more clear as well, indicating on which controls it would or wouldn't work.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a TextBox and add a StateChanged event to its GazeElement:

<TextBox Height="240" gaze:GazeInput.IsSwitchEnabled="True" TextWrapping="Wrap" HorizontalAlignment="Stretch" > <gaze:GazeInput.GazeElement> <gaze:GazeElement StateChanged="GazeElement_StateChanged" /> </gaze:GazeInput.GazeElement> </TextBox>
2. Use an eye tracker and look at the TextBox - nothing happens.
3. Replacing TextBox with Button will work.

Expected behavior

The StateChanged event should trigger on any (atleast 'interactive' control)

Screenshots


Environment

NuGet Package(s): 

Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [X ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X ] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2019 (version: ) 
- [ X] 2019 Preview (version: )

Additional context

Add any other context about the problem here.

Activity

  1. added
    bug 🐛An unexpected issue that highlights incorrect behavior
    on Jan 16, 2020
  2. Kyaa-dost commented on Jan 23, 2020

    @Kyaa-dost
    Contributor

    @harishsk @peteams FYI ⬆️

  3. added this to the 7.0 milestone on Sep 22, 2020
  4. added
    good first issueIssues identified as good for first-time contributors
    help wantedIssues identified as good community contribution opportunities
    on Sep 22, 2020
  5. michael-hawker commented on Sep 22, 2020

    @michael-hawker
    Member

    Thanks @niels9001, we're just converting the gaze to C# (PR #3427), so that should hopefully help us with working on these in the future and looking into this type of bug.

  6. modified the milestones: 7.0, 7.1 on Dec 8, 2020
  7. michael-hawker commented on Aug 31, 2021

    @michael-hawker
    Member

    @harishsk do you know someone (if not yourself) that could help us investigate this? Thanks!

  8. peteams commented on Aug 31, 2021

    @peteams
    Contributor

    I do not believe TextBox has ever been supported. I believe the only controls supported are buttons and button-like controls. Things like buttons tend to perform an action when clicked that can be simulated through fixating gaze. A TextBox has a far richer set of interactions available, I do not believe there is a single simple action that you could define it to perform when fixated.

    A fuller implementation of fixating on a TextBox would perhaps open up a text editing experience. That has not been implemented.

    I would recommend resolving this by documenting this only works for a limited number of controls that are like buttons, and specifically those that implement IInvokeProvider and IToggleProvider are the only ones tested to work. I would also note that the underlying Windows APIs are in the Windows.Devices.Input.Preview namespace.

  9. removed
    bug 🐛An unexpected issue that highlights incorrect behavior
    help wantedIssues identified as good community contribution opportunities
    good first issueIssues identified as good for first-time contributors
    on Aug 31, 2021
  10. michael-hawker commented on Aug 31, 2021

    @michael-hawker
    Member

    Thanks @peteams for the background here, do you think you could open a PR to make a suggested edit for this info to the existing guidance here?

  11. ghost locked as resolved and limited conversation to collaborators on Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions