# 4. Input

SDK provides QIYU controllers APIs. Developer also can refer to the Widget Interaction Component in Unreal Engine: https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/UMG/UserGuide/WidgetInteraction/ (opens new window).

# 4.1 MotionController Component

Controller data is obtained through the MotionController component. You can bind controllers to the MotionController component.

Fig 4.1 MotionController Component

# 4.2 Button Definition and API

You can see the QIYUVRTouch tag in Blueprint. The Blueprint events of QIYU Controller are as follows:

Fig 4.2.1 QIYUTouch Tag
  • Button Input Event:
Fig 4.2.2 Button Input Event
Button Controller Input Event
Home/Menu Left QIYU Touch (L) Menu img
Right QIYU Touch (R) Home
Trigger Left QIYU Touch (L) Trigger img
Right QIYU Touch (R) Trigger
Grip Left QIYU Touch (L) Grip img
Right QIYU Touch (R) Grip
X Left QIYU Touch (L) X Press img
A Right QIYU Touch (R) A Press img
Y Left QIYU Touch (L) Y Press img
B Right QIYU Touch (R) B Press img
Joystick Left QIYU Touch (L) Thumbstick img
Right QIYU Touch (R) Thumbstick
X Touch Left QIYU Touch (L) X Touch img
A Touch Right QIYU Touch (R) A Touch img
Y Touch Left QIYU Touch (L) Y Touch img
B Touch Right QIYU Touch (R) B Touch img
Joystick Touch Left QIYU Touch (L) Thumbstick Touch img
Right QIYU Touch (R) Thumbstick Touch

# 4.3 State and Data Blueprint

Function Name Function Explanation
Connect State Left bool isConnect
Right
Trigger Force Left int32 triggerForce
Right
Grip Force Left int32 gripForce
Right
Whether Controller is shown or not Left bool isShow
Right
Battery Level Left int32 BatteryLevel
Right
Joy Stick Position Left FVector2D JoyStickPos
Right
Controller Position Left FVector Position
Right
Controller Rotation [1] Left FQuat Rotation
Right
Controller Velocity Left FVector velocity
Right
Controller Acceleration Left FVector acceleration
Right
Controller angle Velocity Left FVector angVelocity
Right
Controller Angle Acceleration Left FVector angAcceleration
Right

[1] : To optimized interactive experience of QIYU controllers and adjust rotation data, so that the default initial direction is 35° upward since v1.5.0. Please refer to the following figures. If you have already changed the angle for the controllers, please modify your angle back 35 degree after you upgrade the SDK.

Fig 4.3 Controller default direction changes

Note: If the QIYU controller picture needs to be used in your application, click here (opens new window) to download.

# 4.4 Controller Vibration Blueprint

Please try to use the QIYUController Start Vibration to achieve the vibration

  • QIYU APIs

Fig4.4.1 QIYUControllerStartVibration Blueprint API

Amplitude: Amplitude should be keep within the range of 0 to 1.

Duration: The vibration time, the unit is millisecond and it is keep within the range of 20 to 200000 (the vibration is supported when the duration is set less than 20ms).

  • The APIs from the Unreal Engine

Controller Vibration Blueprint comes from Unreal Engine, please refer to: https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Game/Feedback/PlayHapticEffect/ (opens new window)

Tips: Amplitude should be keep within the range of 0 to 1.

Fig4.4.2 Unreal Engine Blueprint API

At the same time, SDK supports the following Haptic Effect related standard.

  • Set Haptics by Value
Fig4.4.3 Haptics by Value

Function: Haptic Effect will be continue 2 seconds according to amplitude and frequency set.

Inputs:

Target: Input the calling of Player Controller.

Frequency: Haptic Effect frequency, SDK does not support to modify this setting.

Amplitude: Haptic Effect Amplitude, the range 0~1.

Hand: Only supports Left and Right at the moment.

  • Stop Haptic Effect
Fig4.4.4 Stop Haptic Effect

Function: Stop Haptic Effect

Inputs:

Target: Input the calling of PlayerController.

Hand: Only supports Left and Right at the moment.

  • Set Disable Haptics
Fig4.4.5 Set Disable Haptics

Function: Disable Haptics

Inputs:

Target: Input the calling of PlayerController.

New Disabled: Whether disable or not.