コード例 #1
0
    public void AddText(object[] args)
    {
        if (args[0].GetType() == typeof(VRKeyboardKey))
        {
            VRKeyboardKey key = (VRKeyboardKey)args[0];

            if (key.GetMainKey() == ".com")
            {
                m_inputField.text += ".com";
                return;
            }

            switch (key.GetMainKey().ToLower())
            {
            case "bks":
                m_inputField.text = m_inputField.text.Remove(m_inputField.text.Length - 1);
                break;

            case "space":
                m_inputField.text += " ";
                break;

            case "shift":
                break;

            default:
                m_inputField.text += key.GetCurrentKey();
                break;
            }
        }
    }
コード例 #2
0
    public void ShiftKey(object[] args)
    {
        if (isShifted)
        {
            DefaultKey();
        }

        else if (args[0].GetType() == typeof(VRKeyboardKey))
        {
            VRKeyboardKey key = (VRKeyboardKey)args[0];
            if (key.GetMainKey() == "shift")
            {
                ShiftKey();
            }
        }
    }