I have followed all the instructions to the letter, but in the hololens emulator (I don’t yet have access to the real thing!) a tap (space-bar) in “Human Input Mode” does not seem to be working on a regular old button.
If I switch to “Keyboard and Mouse Input”, it all works fine if I click on the button.
What is strange is that I implemented my own raycast script that uses EventSystem.current.RaycastAll, and this way the tap works… which leads me to believe there may be something off in the HoloLensInputModule.
I’ve attached my test project, which has a huge button to be activated:
Deactivate my CustomUIEvent object and build and run on the emulator: centering the button and pressing spacebar has no effect (it should increment the number)
Activate my CustomUIEvent object, build and run on the emulator : now if the button is centered, the number increments.
Hi kaiwen - apologies on the late reply to your post.
I was sometimes able to reproduce your issue just now, and I believe I know what the problem is. Unfortunately, HoloLensInputModule was not tested with the emulator and needs some touching up to play nicely with UI’s event system seamlessly switching between it and other input modules (in this case, the StandaloneInputModule).
A workaround until we can get that fixed should be to remove the StandaloneInputModule from EventSystem in your scene when you deploy to the emulator. The workaround could become a bit of a pain, however, if you switch between playing in editor and deploying to the emulator a lot, since with keeping StandaloneInputModule attached enables mouse and keyboard input in play-in-editor mode.
Let me know if that workaround doesn’t pan out for you - that would indicate something else is wrong that requires further attention on our side to get this to work properly for you in the future.
I tried the workaround suggested by you. Unfortunately, the UI buttons are still not responding to the “spacebar” in the HoloLens Emulator. Is there any other workaround for this problem.
And also, if I deploy the same application in HoloLens, will the button respond then.