question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Steam now supports the Switch controller. But you need to extend the enums to get it working. The extensions to the enums are reported in the forums:

	public enum EControllerActionOrigin : int {
		...
		k_EControllerActionOrigin_SteamV2_Gyro_Roll, 
		
		// Switch - Pro or Joycons used as a single input device. 
		// This does not apply to a single joycon 
		k_EControllerActionOrigin_Switch_A, 
		k_EControllerActionOrigin_Switch_B, 
		k_EControllerActionOrigin_Switch_X, 
		k_EControllerActionOrigin_Switch_Y, 
		k_EControllerActionOrigin_Switch_LeftBumper, 
		k_EControllerActionOrigin_Switch_RightBumper, 
		k_EControllerActionOrigin_Switch_Plus,  //Start 
		k_EControllerActionOrigin_Switch_Minus,  //Back 
		k_EControllerActionOrigin_Switch_Capture, 
		k_EControllerActionOrigin_Switch_LeftTrigger_Pull, 
		k_EControllerActionOrigin_Switch_LeftTrigger_Click, 
		k_EControllerActionOrigin_Switch_RightTrigger_Pull, 
		k_EControllerActionOrigin_Switch_RightTrigger_Click, 
		k_EControllerActionOrigin_Switch_LeftStick_Move, 
		k_EControllerActionOrigin_Switch_LeftStick_Click, 
		k_EControllerActionOrigin_Switch_LeftStick_DPadNorth, 
		k_EControllerActionOrigin_Switch_LeftStick_DPadSouth, 
		k_EControllerActionOrigin_Switch_LeftStick_DPadWest, 
		k_EControllerActionOrigin_Switch_LeftStick_DPadEast, 
		k_EControllerActionOrigin_Switch_RightStick_Move, 
		k_EControllerActionOrigin_Switch_RightStick_Click, 
		k_EControllerActionOrigin_Switch_RightStick_DPadNorth, 
		k_EControllerActionOrigin_Switch_RightStick_DPadSouth, 
		k_EControllerActionOrigin_Switch_RightStick_DPadWest, 
		k_EControllerActionOrigin_Switch_RightStick_DPadEast, 
		k_EControllerActionOrigin_Switch_DPad_North, 
		k_EControllerActionOrigin_Switch_DPad_South, 
		k_EControllerActionOrigin_Switch_DPad_West, 
		k_EControllerActionOrigin_Switch_DPad_East, 
		k_EControllerActionOrigin_Switch_ProGyro_Move,  // Primary Gyro in Pro Controller, or Right JoyCon 
		k_EControllerActionOrigin_Switch_ProGyro_Pitch,  // Primary Gyro in Pro Controller, or Right JoyCon 
		k_EControllerActionOrigin_Switch_ProGyro_Yaw,  // Primary Gyro in Pro Controller, or Right JoyCon 
		k_EControllerActionOrigin_Switch_ProGyro_Roll,  // Primary Gyro in Pro Controller, or Right JoyCon 
		// Switch JoyCon Specific 
		k_EControllerActionOrigin_Switch_RightGyro_Move,  // Right JoyCon Gyro generally should correspond to Pro's single gyro 
		k_EControllerActionOrigin_Switch_RightGyro_Pitch,  // Right JoyCon Gyro generally should correspond to Pro's single gyro 
		k_EControllerActionOrigin_Switch_RightGyro_Yaw,  // Right JoyCon Gyro generally should correspond to Pro's single gyro 
		k_EControllerActionOrigin_Switch_RightGyro_Roll,  // Right JoyCon Gyro generally should correspond to Pro's single gyro 
		k_EControllerActionOrigin_Switch_LeftGyro_Move, 
		k_EControllerActionOrigin_Switch_LeftGyro_Pitch,
		k_EControllerActionOrigin_Switch_LeftGyro_Yaw, 
		k_EControllerActionOrigin_Switch_LeftGyro_Roll, 
		k_EControllerActionOrigin_Switch_LeftGrip_Lower,  // Left JoyCon SR Button 
		k_EControllerActionOrigin_Switch_LeftGrip_Upper,  // Left JoyCon SL Button 
		k_EControllerActionOrigin_Switch_RightGrip_Lower,  // Right JoyCon SL Button 
		k_EControllerActionOrigin_Switch_RightGrip_Upper,  // Right JoyCon SR Button 
		k_EControllerActionOrigin_Count,  // If Steam has added support for new controllers origins will go here. 
		k_EControllerActionOrigin_MaximumPossibleValue = 32767,  // Origins are currently a maximum of 16 bits.	
	}

	...

	public enum ESteamInputType : int {
		k_ESteamInputType_Unknown,
		k_ESteamInputType_SteamController,
		k_ESteamInputType_XBox360Controller,
		k_ESteamInputType_XBoxOneController,
		k_ESteamInputType_GenericXInput,
		k_ESteamInputType_PS4Controller,
		k_ESteamInputType_AppleMFiController, 
		k_ESteamInputType_AndroidController, 
		k_ESteamInputType_Reserved1, 
		k_ESteamInputType_Reserved2, 
		k_ESteamInputType_SwitchProController
	}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
rlabrecquecommented, Mar 15, 2019

Should be updated as of 1.43!

0reactions
KelsamGamescommented, Dec 17, 2018

The most up-to-date enum for the InputDevice is:

enum ESteamInputType
{
	k_ESteamInputType_Unknown,
	k_ESteamInputType_SteamController,
	k_ESteamInputType_XBox360Controller,
	k_ESteamInputType_XBoxOneController,
	k_ESteamInputType_GenericGamepad,		// DirectInput controllers
	k_ESteamInputType_PS4Controller,
	k_ESteamInputType_AppleMFiController,	// Unused
	k_ESteamInputType_AndroidController,	// Unused
	k_ESteamInputType_SwitchJoyConPair,		// Unused
	k_ESteamInputType_SwitchJoyConSingle,	// Unused
	k_ESteamInputType_SwitchProController,
	k_ESteamInputType_MobileTouch,			// Steam Link App On-screen Virtual Controller
	k_ESteamInputType_PS3Controller,		// Currently uses PS4 Origins
};

Notably, k_ESteamInputType_GenericXInput seems to be changed to k_ESteamInputType_GenericGamepad for the next SDK version. I believe the reason for this (as far as my testing can show) is that actual Generic X Input devices are reported to be x360 devices. So, only actual DirectInput devices would report value 4 (this also reflects my testing experience).

It’s also noted that k_ESteamInputType_AppleMFiController and k_ESteamInputType_AndroidController should be reported by Steam when Steam Link Touch is used, but thus far I’ve only ever received an 11 report (which will be k_ESteamInputType_MobileTouch), so probably best to either catch-all, or at least make sure to also capture value 11 as a “generic Steam Link Touch device”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enum Types - Learning the Java Language
An enum type is a special data type that enables for a variable to be a set of predefined constants. The variable must...
Read more >
Java Enums
An enum is a special "class" that represents a group of constants (unchangeable variables, like final variables). To create an enum , use...
Read more >
Instantiate enum class - java
Enums are for when you have a fixed set of related constants. Exactly one instance will be created for each enum constant. Share....
Read more >
enum — Support for enumerations
The enum class being called. value. The name of the new Enum to create. names. The names/values of the members for the new...
Read more >
enum in Java
A Java enumeration is a class type. Although we don't need to instantiate an enum using new, it has the same capabilities as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found