cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

How to get user input in Hololens project

Velkumar
18-Opal

How to get user input in Hololens project

Hi all,

 

I'm looking for a way to get user input in Hololens project.

 

/VR

4 REPLIES 4

Hi @Velkumar ,

 

possible could be to have 3d buttons for character's input and confirm/ some  kind of  virtual keyboard which you can display and click for the input of text. you can use a 3dImage widget showing a dynamic generated svg image, where you can display the text which is inputted 

you can also try to use some voice command for inputs of few options

Hi @RolandRaytchev 

 

Thanks for your response. It will be helpful if you provide some steps/codes/example.

 

/VR

Hi @Velkumar ,

 

when I have such code I will provide it, this is what I generally do  when  I am try ing to answer a post. Unfortunately, I do not have such code, but wanted to provide some hint / a small info is better as nothing. The idea what I mention is that what I will start to consider if I have a similar issue and therefore, I mentioned it. You can consider it or ignored it, this is your choice. Possible another community member could provide another more helpful idea which was already tested more detailed in project.

If you have still problem and there is no other post with solution, I could check it next time more detailed in a demo project.

I checked it further but it seem that the one  option I mentioned is not availible on the HoloLens. So, it seems that we cannot input a spoken text

For example you can use some code  in a HoloLens project as it was described in the link https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition

This will work perfectly in browser but it will not work on HoloLens because seems that  the speech recognition is something which requires a device specific API.

So for example when I tested   in preview mode:

 

2020-03-09_15-56-19.jpg

 

Tested on HoloLens but it did not work.

On HoloLens we can define commands named e.g.  foo with alias foo which could call  function e.g. foo defined in javascript: 

 

 

/////////////////////
$scope.app.foo= function() {$scope.app.speak("foo was called here");}
//==============
$scope.app.speak = function (msg_txt)
{
  console.log("speak :: "+ msg_txt);

if(twx.app.isPreview() == true){  
var msg = new SpeechSynthesisUtterance(msg_txt);
speechSynthesis.speak(msg)
} else { //HoloLens   
  $scope.app.speech.synthesizeSpeech({'text':msg_txt});   
 }
}

 

 

 and then refering in the foo cmd:

 

 

viewCtrl.app.foo();

 

 

 

This is what I meant   saying restricted options - here the alias  foo will call the function foo() which could be interpreted as input of a particular  option . You can use this as some kind ,  restricted enumerated input,

I checked in the internal community and there was aa post from development where was mentioned that currently we cannot use a general speech recognition for dictation at this time

 

Announcements

Top Tags