Is it possible to use Gaze Input in an Electron UWP app? RRS feed

  • Question

  • I am a single developer supporting a communication app for people with special needs across systems (Windows, iOS, Android) so for Windows I use Electron, which can be packaged up as a UWP app (https://electronjs.org/docs/tutorial/windows-store-guide). One of our requirements is to support eye gaze, and in the past we have supported direct integration with vendor eye gaze drivers, but now that Microsoft's Gaze Input option is out and people are starting to use it, we need to add support if we can.

    My understanding is that the Electron executable, as a win32 binary, won't have access to UWP APIs, but that you can register a background UWP process (https://github.com/felixrieseberg/electron-uwp-background) to add support for WinRT APIs like Windows.Device.Input.Preview.

    I'll confess to being outside of my dev comfort zone here, but I'm wondering if what I'm looking for is even possible? The Gaze Input APIs expects you to define a region in the active window to register for gaze events, can you do this from a background process? I don't see a way to register a listener for all gaze events on-screen, which would be the other alternative if I could get it working.

    Anyway, any help or pointers would be much appreciated. I realize I'm on the double-fringe here (Electron and brand new WinRT APIs), but crossing my fingers!


    • Moved by Barry Wang Thursday, March 28, 2019 5:59 AM
    Wednesday, March 27, 2019 10:36 PM

All replies

  • Hello Brian,

    For Electron UWP issue please contact Electron support instead of here. And just for UWP side question, I just want to share the following info:

    Please have a look at this doc:


    The important API: TryEnableGazeTrackingAsync need to be run on UI thread. 

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, March 28, 2019 5:59 AM