private int GetPressInputMapping(int pressIds_Index, keyMappingInputType status)
    {
        WVR_InputId _btn    = pressIds[pressIds_Index];
        bool        _result = WaveVR_ButtonList.Instance != null?WaveVR_ButtonList.Instance.GetInputMappingPair(this.device, ref _btn) : false;

        if (!_result)
        {
            PrintInfoLog("GetInputMappingPair failed[" + pressIds[pressIds_Index] + "].");
            return(-1);
        }

        int _index = -1;

        for (int i = 0; i < pressIds.Length; i++)
        {
            if (pressObjectArrays[i].hasEffect && _btn == pressIds[i])
            {
                _index = i;
                break;
            }
        }

        if (_index >= 0 && _index < pressIds.Length)
        {
            PrintInfoLog(status.ToString() + " button: " + pressIds[pressIds_Index] + " is mapped to " + _btn);
        }
        else
        {
            PrintInfoLog("Can't get index in pressIds.");
        }

        return(_index);
    }
Beispiel #2
0
    private int GetTouchInputMapping(int touchIds_Index, keyMappingInputType status)
    {
        WVR_InputId _btn    = touchIds[touchIds_Index];
        bool        _result = WaveVR_ButtonList.Instance.GetInputMappingPair(this.device, ref _btn);

        if (!_result)
        {
            PrintInfoLog("GetInputMappingPair failed.");
            return(-1);
        }

        int _index = -1;

        for (int i = 0; i < touchIds.Length; i++)
        {
            if (_btn == touchIds[i])
            {
                _index = i;
                break;
            }
        }

        if (_index >= 0 && _index < touchIds.Length)
        {
            PrintInfoLog(status.ToString() + " button: " + touchIds[touchIds_Index] + " is mapped to " + _btn);
        }
        else
        {
            PrintInfoLog("Can't get index in touchIds.");
        }

        return(_index);
    }
    private int GetTouchInputMapping(int touchIds_Index, keyMappingInputType status)
    {
        WVR_InputId _btn    = touchIds[touchIds_Index];
        bool        _result = WaveVR_ButtonList.Instance != null?WaveVR_ButtonList.Instance.GetInputMappingPair(this.device, ref _btn) : false;

        if (!_result)
        {
            PrintInfoLog("GetInputMappingPair failed[" + touchIds[touchIds_Index] + "].");
            return(-1);
        }

        int _index = -1;

        for (int i = 0; i < touchIds.Length; i++)
        {
            if (touchObjectArrays[i].hasEffect && _btn == touchIds[i])
            {
                _index = i;
                break;
            }
        }

        if (_index >= 0 && _index < touchIds.Length)
        {
            PrintInfoLog(status.ToString() + " button: " + touchIds[touchIds_Index] + " is mapped to " + _btn);
        }
        else
        {
            PrintInfoLog("Can't get index in touchIds.");
        }

        if (touchIds[touchIds_Index] == WVR_InputId.WVR_InputId_Alias1_Thumbstick &&      // dst
            _btn == WVR_InputId.WVR_InputId_Alias1_Thumbstick)                // src
        {
            PrintInfoLog("Touch effect doesn't support Thumbstick now!");
            _index = -1;
        }

        return(_index);
    }