WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

GazeElement StateChanged not working on TextBox?

Open niels9001 opened this issue 6 years ago • 5 comments

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.

niels9001 avatar Jan 16 '20 13:01 niels9001

@harishsk @peteams FYI ⬆️

Kyaa-dost avatar Jan 23 '20 21:01 Kyaa-dost

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.

michael-hawker avatar Sep 22 '20 21:09 michael-hawker

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

michael-hawker avatar Aug 31 '21 16:08 michael-hawker

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.

peteams avatar Aug 31 '21 17:08 peteams

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?

michael-hawker avatar Aug 31 '21 18:08 michael-hawker