CheriseTabbiner-6997 avatar image
0 Votes"
CheriseTabbiner-6997 asked HernandoRen-MSFT commented

How can i use Gaze and Commit with Eye Gaze and a Mouse Click on the Hololens2 within unity?

I was wondering if it was possible to integrate a bluetooth mouse into my hololens2 application and use it in a gaze and commit setting, where i use my eyes to gaze at the hologram and then the left mouse button to commit this action. Mouse input is not specified here: but i am assuming it would be similar to the hololens clicker?

if so how would one implement this,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

HernandoRen-MSFT avatar image
0 Votes"
HernandoRen-MSFT answered HernandoRen-MSFT commented

Hello, Welcome to Microsoft Q&A,

You can take a look at MRTK, Mouse device is available out of the box as an input provider. And you can assign the input actions of the mouse button via the Controller Input Mapping Profile, under the Input System Profile in the Mixed Reality Toolkit component.
In the default Mouse Controller configuration, Left Mouse Button is mapped to Select and Right Mouse Button is mapped to Menu.

If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am attempting to use the input actions example as set here: and have also added a mouse input in an attempt to rotate the shape when the left mouse button is clicked. This works fine within unity, following the mapping that you have suggested, (thank you for this explanation)

My Bluetooth mouse connected to the hololens2 works in the menu (can open and close applications and see the cursor) when i open my application, the cursor shows up and moves with the mouse, the buttons however do not do anything(do not rotate the object as expected) .

so essentially it seems that my house can connect to the hololens but isn't available within my project (only available within the unity project) if that all makes sense

Thank you

0 Votes 0 ·
HernandoRen-MSFT avatar image HernandoRen-MSFT CheriseTabbiner-6997 ·

If you are using Unity 2020 with OpenXR backend, Unity defaults to the new input APIs. It turned out that the mouse provider is no longer available because it relies on the legacy input APIs. For more information please see: Update usages of the old input APIs to the new input system (input simulation, keyboard/mouse provider, touch screen, etc) #9703.

0 Votes 0 ·

is there an alternative to unity 2020 that i could use that would still allow for this functionality that you know of? it appears that this functionality has not yet been introduced back into MRTK 2.7 and is still in the works from the link you provided.

0 Votes 0 ·
Show more comments