Last active
April 20, 2016 19:00
-
-
Save error454/f3dfb860629efaa12e954a71521e63cd to your computer and use it in GitHub Desktop.
SteamVR UE4 Motion Controller Mappings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ActionMappings=(ActionName="MenuButtonLeft",Key=MotionController_Left_Shoulder,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="LeftTouchpadPress",Key=MotionController_Left_Thumbstick,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="LeftTouchpadTouch",Key=Steam_Touch_0,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="LeftGrip",Key=MotionController_Left_Grip1,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="LeftTrigger",Key=MotionController_Left_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="MenuButtonRight",Key=MotionController_Right_Shoulder,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="RightTouchpadPress",Key=MotionController_Right_Thumbstick,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="RightTouchpadTouch",Key=Steam_Touch_1,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="RightGrip",Key=MotionController_Right_Grip1,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+ActionMappings=(ActionName="RightTrigger",Key=MotionController_Right_Trigger,bShift=False,bCtrl=False,bAlt=False,bCmd=False) | |
+AxisMappings=(AxisName="LeftTriggerAnalog",Key=MotionController_Left_TriggerAxis,Scale=1.000000) | |
+AxisMappings=(AxisName="LeftTouchpadX",Key=MotionController_Left_Thumbstick_X,Scale=1.000000) | |
+AxisMappings=(AxisName="LeftTouchpadY",Key=MotionController_Left_Thumbstick_Y,Scale=1.000000) | |
+AxisMappings=(AxisName="RightTriggerAnalog",Key=MotionController_Right_TriggerAxis,Scale=1.000000) | |
+AxisMappings=(AxisName="RightTouchpadX",Key=MotionController_Right_Thumbstick_X,Scale=1.000000) | |
+AxisMappings=(AxisName="RightTouchpadY",Key=MotionController_Right_Thumbstick_Y,Scale=1.000000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample CPP player input component binding | |
void AMyClass::SetupPlayerInputComponent(class UInputComponent* InputComponent) | |
{ | |
Super::SetupPlayerInputComponent(InputComponent); | |
// Left hand | |
InputComponent->BindAction("MenuButtonLeft", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlLeftMenu); | |
InputComponent->BindAction("LeftTouchpadPress", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlLeftTouchPressed); | |
InputComponent->BindAction("LeftTouchpadTouch", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlLeftTouchTouched); | |
InputComponent->BindAction("LeftGrip", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlLeftGrip); | |
InputComponent->BindAction("LeftTrigger", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlLeftTrigger); | |
// Value ranges from [0, 1] Unpressed to fully pressed | |
InputComponent->BindAxis("LeftTriggerAnalog", this, &AMyClass::MotionControlAxisUpdateLeft); | |
// Coordinate space is [-1, 1] Left to Right | |
InputComponent->BindAxis("LeftTouchpadX", this, &AMyClass::MotionControlTouchpadUpdateLeftX); | |
// Coordinate space is [-1, 1] Top to Bottom | |
InputComponent->BindAxis("LeftTouchpadY", this, &AMyClass::MotionControlTouchpadUpdateLeftY); | |
// Right hand | |
InputComponent->BindAction("MenuButtonRight", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlRightMenu); | |
InputComponent->BindAction("RightTouchpadPress", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlRightTouchPressed); | |
InputComponent->BindAction("RightTouchpadTouch", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlRightTouchTouched); | |
InputComponent->BindAction("RightGrip", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlRightGrip); | |
InputComponent->BindAction("RightTrigger", EInputEvent::IE_Pressed, this, &AMyClass::MotionControlRightTrigger); | |
InputComponent->BindAxis("RightTriggerAnalog", this, &AMyClass::MotionControlAxisUpdateRight); | |
InputComponent->BindAxis("RightTouchpadX", this, &AMyClass::MotionControlTouchpadUpdateRightX); | |
InputComponent->BindAxis("RightTouchpadY", this, &AMyClass::MotionControlTouchpadUpdateRightY); | |
} | |
// Define all your .h functions below to do the actual stuff | |
// i.e. | |
void AMyClass::MotionControlLeftMenu() | |
{ | |
// ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample function headers that you will bind calls to | |
UFUNCTION() | |
virtual void MotionControlLeftMenu(); | |
UFUNCTION() | |
virtual void MotionControlLeftTouchPressed(); | |
UFUNCTION() | |
virtual void MotionControlLeftTouchTouched(); | |
UFUNCTION() | |
virtual void MotionControlLeftGrip(); | |
UFUNCTION() | |
virtual void MotionControlLeftTrigger(); | |
UFUNCTION() | |
virtual void MotionControlAxisUpdateLeft(float value); | |
UFUNCTION() | |
virtual void MotionControlTouchpadUpdateLeftX(float value); | |
UFUNCTION() | |
virtual void MotionControlTouchpadUpdateLeftY(float value); | |
UFUNCTION() | |
virtual void MotionControlRightMenu(); | |
UFUNCTION() | |
virtual void MotionControlRightTouchPressed(); | |
UFUNCTION() | |
virtual void MotionControlRightTouchTouched(); | |
UFUNCTION() | |
virtual void MotionControlRightGrip(); | |
UFUNCTION() | |
virtual void MotionControlRightTrigger(); | |
UFUNCTION() | |
virtual void MotionControlAxisUpdateRight(float value); | |
UFUNCTION() | |
virtual void MotionControlTouchpadUpdateRightX(float value); | |
UFUNCTION() | |
virtual void MotionControlTouchpadUpdateRightY(float value); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment