AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
KeyboardKeyFunc.cs
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See LICENSE in the project root for license information.
3 
4 using UnityEngine;
5 using UnityEngine.UI;
6 
7 namespace HoloToolkit.UI.Keyboard
8 {
12  [RequireComponent(typeof(Button))]
13  public class KeyboardKeyFunc : MonoBehaviour
14  {
18  public enum Function
19  {
20  // Commands
21  Enter,
22  Tab,
23  ABC,
24  Symbol,
25  Previous,
26  Next,
27  Close,
28  Dictate,
29 
30  // Editing
31  Shift,
32  CapsLock,
33  Space,
34  Backspace,
35 
36  UNDEFINED,
37  }
38 
42  public Function m_ButtonFunction = Function.UNDEFINED;
43 
47  private Button m_Button = null;
48 
52  private void Awake()
53  {
54  m_Button = GetComponent<Button>();
55  }
56 
60  private void Start()
61  {
62  m_Button.onClick.RemoveAllListeners();
63  m_Button.onClick.AddListener(new UnityEngine.Events.UnityAction(FireFunctionKey));
64  }
65 
69  private void FireFunctionKey()
70  {
71  Keyboard.Instance.FunctionKey(this);
72  }
73  }
74 }
Represents a key on the keyboard that has a function.
A simple general use keyboard that is ideal for AR/VR applications.
Definition: Keyboard.cs:21
static T Instance
Returns the Singleton instance of the classes type. If no instance is found, then we search for an in...
Definition: Singleton.cs:26
Function
Possible functionality for a button.