SDK Buttons

Introduction

WaveVR SDK supports buttons listed below:

Format: SDK button (MotionController button)

  • Menu (Facebutton1)
  • Grip (Grip1)
  • DPad Left (Thumbstick left)
  • DPad Up (Thumbstick Up)
  • DPad Right (Thumbstick Right)
  • DPad Down (Thumbstick Down)
  • Volume Up (AndroidVolumeUp)
  • Volume Down (AndroidVolumeDown)
  • Touchpad (Thumbstick)
  • Trigger (Trigger)
  • Thumbstick (Thumbstick)

Defined in PluginsWaveVRSourceWaveVRPrivateWaveVRHMD.h

static const int InputAttributes_Controller_Count = 11;
WVR_InputAttribute InputAttributes_Controller[InputAttributes_Controller_Count] = {
        {WVR_InputId_Alias1_Menu, WVR_InputType_Button, WVR_AnalogType_None},
        {WVR_InputId_Alias1_Grip, WVR_InputType_Button, WVR_AnalogType_None},
        {WVR_InputId_Alias1_DPad_Left, WVR_InputType_Button, WVR_AnalogType_None},
        {WVR_InputId_Alias1_DPad_Up, WVR_InputType_Button, WVR_AnalogType_None},
        {WVR_InputId_Alias1_DPad_Right, WVR_InputType_Button, WVR_AnalogType_None},
        {WVR_InputId_Alias1_DPad_Down, WVR_InputType_Button, WVR_AnalogType_None},
        {WVR_InputId_Alias1_Volume_Up, WVR_InputType_Button, WVR_AnalogType_None},
        {WVR_InputId_Alias1_Volume_Down, WVR_InputType_Button, WVR_AnalogType_None},

        {WVR_InputId_Alias1_Touchpad, WVR_InputType_Button | WVR_InputType_Touch | WVR_InputType_Analog, WVR_AnalogType_2D},
        {WVR_InputId_Alias1_Thumbstick, WVR_InputType_Button | WVR_InputType_Touch | WVR_InputType_Analog, WVR_AnalogType_2D},

        {WVR_InputId_Alias1_Trigger, WVR_InputType_Button | WVR_InputType_Touch | WVR_InputType_Analog, WVR_AnalogType_1D},
};

Note: We recommend to call API

bool UWaveVRBlueprintFunctionLibrary::IsButtonAvailable(EWVR_DeviceType type, EWVR_InputId button)

to check if a button is available.

WaveVR (Pressed, Unpressed, Touched and Untouched)

Blueprint

In Blueprint, there are APIs can be used to get buttons’ press / touch states.

The buttons are define in WaveVRBlueprintFunctionLibrary.h

UENUM(BlueprintType)
enum class EWVR_InputId : uint8
{
            NoUse = WVR_InputId::WVR_InputId_Alias1_System,
            Menu = WVR_InputId::WVR_InputId_Alias1_Menu,
            Grip = WVR_InputId::WVR_InputId_Alias1_Grip,
            DPad_Left = WVR_InputId::WVR_InputId_Alias1_DPad_Left,
            DPad_Up = WVR_InputId::WVR_InputId_Alias1_DPad_Up,
            DPad_Right = WVR_InputId::WVR_InputId_Alias1_DPad_Right,
            DPad_Down = WVR_InputId::WVR_InputId_Alias1_DPad_Down,
            Volume_Up = WVR_InputId::WVR_InputId_Alias1_Volume_Up,
            Volume_Down = WVR_InputId::WVR_InputId_Alias1_Volume_Down,
            Digital_Trigger = WVR_InputId::WVR_InputId_Alias1_Digital_Trigger,
            Back = WVR_InputId::WVR_InputId_Alias1_Back,
            Enter = WVR_InputId::WVR_InputId_Alias1_Enter,
            Touchpad = WVR_InputId::WVR_InputId_Alias1_Touchpad,
            Trigger = WVR_InputId::WVR_InputId_Alias1_Trigger,
            Thumbstick = WVR_InputId::WVR_InputId_Alias1_Thumbstick,

Right-click in Blueprint Event Graph and type WaveVR to see APIs under subtitle:

  • Input
../_images/Unreal_WaveVR_Input_BlueprintFunctionLibrary.png

The API IsInputButtonPressed, IsInputButtonTouched and GetInputButtonAxis of subtitle Input support left-handed mode.

../_images/UnrealControllerButtons_IsInputButtonPressed.png

Developer can see available Button Id but the Power / System key is NOT in the list (unavailable).

C++

In C++, developer can write code like:

UWaveVRInputFunctionLibrary::IsInputButtonPressed(EWVR_DeviceType device, EWVR_InputId button_id)

to get states of specified button_id of device.

WaveVR (Press Up / Down and Touch Up / Down)

Unreal provides the input engine for developer to get buttons’ states.

In Settings -> Project Settings -> Engine/Input, developer can see the Action & Axis button definitions.

../_images/Unreal_WaveVR_Plugin_ActionMappings.png ../_images/Unreal_WaveVR_Plugin_AxisMappings.png

In C++ code (e.g. Pawn), developer can listen to button’s state in SetupPlayerInputComponent:

PlayerInputComponent->BindAction("TouchpadPress_Right", IE_Pressed, this, <your function reference>);
PlayerInputComponent->BindAction("TouchpadPress_Right", IE_Released, this, <your function reference>);

In Blueprint, developer should Enable Input:

../_images/Unreal_WaveVR_EnableInput.png

Then adding key(s) by right-click -> type Input Action -> select event (e.g. TouchpadPress_Right):

../_images/Unreal_WaveVR_InputAction.png ../_images/Unreal_WaveVR_Input_TouchpadPress_Right.png