Reputation: 21
so I am super new to unity and hololense, but I wanted to get an idea for how to add this specific feature. I want to be able to print the individual letter that is selected as the user moves through the hololens keyboard. So for example, if the user moves across the middle of the keyboard, the application should print a new line for every letter that is selected and it would look something like below.
Selected: a Selected: s Selected: d .... Selected: j Selected: k Selected: l
I have done some research into this, but the closest thing I have found is the getkey() method, but from what I understand for that method the user needs to actually click the individual letter for it to be registered. From what I read from the Unity forum, this feature looks to be feasible, but I haven't found any specifics on how to do it. I'd really appreciate any suggestions. Thank you in advance
Upvotes: 1
Views: 123
Reputation: 2900
We recommend you use the Non-Native Keyboard of MRTK2.3 to make things easier. You just need to implement IPointerEnterHandler
interface for KeyboardValueKey
class in KeyboardValueKey.cs script:
public void OnPointerEnter(PointerEventData eventData)
{
Debug.Log("Select: " + Value);
}
This method is called when the pointer has hovered over a certain GameObject. Besides, if you are not familiar with NonnativeKeyboard, the example scene, in MixedRealityToolkit.Examples\Experimental\NonnativeKeyboard\Scenes\NonNativeKeyboardExample, will show how to use Non-Native Keyboard .
Upvotes: 2