Steamworks 文獻庫
ISteamController 介面(已棄用)
Steam 控制器支援 API。

This API has been deprecated in favor of ISteamInput - please see ISteamInput 介面 for API info

See the Steam 輸入 documentation for more information.

成員函式

Member functions for ISteamController are called through the global accessor function SteamController().

ActivateActionSet

void ActivateActionSet( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle );
名稱型別說明
controllerHandleControllerHandle_t欲啟動其操作組合的控制器控制代碼 。
actionSetHandleControllerActionSetHandle_t欲啟動的操作組合的控制代碼。

Reconfigure the controller to use the specified action set (ie "Menu", "Walk", or "Drive").

This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in your state loops, instead of trying to place it in all of your state transitions.

範例:
void updateStateLoop() { switch( currentState ) { case MENU: SteamController()->ActivateActionSet( controllerHandle1, menuSetHandle ); doMenuStuff(); break; case WALKING: SteamController()->ActivateActionSet( controllerHandle1, walkingSetHandle ); doWalkingStuff(); break; case DRIVING: SteamController()->ActivateActionSet( controllerHandle1, drivingSetHandle ); doDrivingStuff(); break; case FIGHTING: SteamController()->ActivateActionSet( controllerHandle1, fightingSetHandle ); doFightingStuff(); break; } }

啟動所有控制器

通常應會一次啟動所有控制器,而非單個裝置。 因此,應使用 STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS 常數作為控制器的控制代碼。 其它函式也可以用類似的方式,以此值呼叫各別控制器的控制代碼。

範例:
void updateStateLoop() { switch( currentState ) { case MENU: SteamController()->ActivateActionSet( STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS, menuSetHandle ); doMenuStuff(); break; case WALKING: SteamController()->ActivateActionSet( STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS, walkingSetHandle ); doWalkingStuff(); break; case DRIVING: SteamController()->ActivateActionSet( STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS, drivingSetHandle ); doDrivingStuff(); break; case FIGHTING: SteamController()->ActivateActionSet( STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS, fightingSetHandle ); doFightingStuff(); break; } }

ActivateActionSetLayer

void ActivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle );
名稱型別說明
controllerHandleControllerHandle_t欲啟動其操作組合階層的控制器控制代碼 。
actionSetHandleControllerActionSetHandle_t欲啟動的操作組合階層的控制代碼。

Reconfigure the controller to use the specified action set layer.

See the 操作組合階層 article for full details and an in-depth practical example.

範例:
SteamController()->ActivateActionSetLayer( controllerHandle1, myActionSetLayer );

DeactivateActionSetLayer

void DeactivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle );
名稱型別說明
controllerHandleControllerHandle_t欲停用其操作組合階層的控制器控制代碼 。
actionSetHandleControllerActionSetHandle_t欲停用的操作組合階層的控制代碼。

Reconfigure the controller to stop using the specified action set layer.

範例:
SteamController()->DeactivateActionSetLayer( controllerHandle1, myActionSetLayer );

DeactivateAllActionSetLayers

void DeactivateAllActionSetLayers( ControllerHandle_t controllerHandle );
名稱型別說明
controllerHandleControllerHandle_t欲停用其所有操作組合階層的控制器控制代碼 。

Reconfigure the controller to stop using all action set layers.

範例:
SteamController()->DeactivateAllActionSetLayers( controllerHandle1 );

GetActiveActionSetLayers

int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t *handlesOut );
名稱型別說明
controllerHandleControllerHandle_t欲停用其所有操作組合階層的控制器控制代碼 。
handlesOutControllerActionSetHandle_t*必須指向一個大小為 STEAM_CONTROLLER_MAX_COUNT 的 ControllerHandle_t 的陣列。

Fill an array with all of the currently active action set layers for a specified controller handle.

範例:
ControllerHandle_t *handlesOut = new ControllerHandle_t []; SteamController()->GetActiveActionSetLayers( controllerHandle1, &handlesOut );

GetActionSetHandle

ControllerActionSetHandle_t GetActionSetHandle( const char *pszActionSetName );
名稱型別說明
pszActionSetNameconst char *在遊戲的 VDF 檔中定義的操作組合識別字串。

Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls.

傳回: ControllerActionSetHandle_t
The handle of the specified action set.

範例:
ControllerActionSetHandle_t fightingSetHandle = SteamController()->GetActionSetHandle( "fighting" );

GetAnalogActionData

ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle );
名稱型別說明
controllerHandleControllerHandle_t欲查詢的控制器控制代碼。
analogActionHandleControllerAnalogActionHandle_t欲查詢的類比動作控制代碼。

Returns the current state of the supplied analog game action.

傳回: ControllerAnalogActionData_t
The current state of the specified analog action.

範例:
ControllerAnalogActionData_t data = SteamController()->GetAnalogActionData( controller1Handle, moveHandle );

GetAnalogActionHandle

ControllerAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName );
名稱型別說明
pszActionNameconst char *遊戲的 VDF 檔中定義的類比動作的識別字串。

Get the handle of the specified Analog action.

備註: This function does not take an action set handle parameter. That means that each action in your VDF file must have a unique string identifier. In other words, if you use an action called "up" in two different action sets, this function will only ever return one of them and the other will be ignored.

傳回: ControllerAnalogActionHandle_t
The handle of the specified analog action.

範例:
ControllerAnalogActionHandle_t moveHandle = SteamController()->GetAnalogActionHandle( "move" );

GetAnalogActionOrigins

int GetAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin *originsOut );
名稱型別說明
controllerHandleControllerHandle_t欲查詢的控制器控制代碼。
actionSetHandleControllerActionSetHandle_t欲查詢的操作組合控制代碼。
analogActionHandleControllerAnalogActionHandle_t欲查詢的類比動作控制代碼。
originsOutEControllerActionOrigin *STEAM_CONTROLLER_MAX_ORIGINS 大小的 EControllerActionOrigin 控制代碼陣列。

Get the origin(s) for an analog action within an action set by filling originsOut with EControllerActionOrigin handles. Use this to display the appropriate on-screen prompt for the action.

傳回: int
The number of origins supplied in originsOut.

範例:
EControllerActionOrigin *origins = new EControllerActionOrigin[]; SteamController()->GetAnalogActionOrigins( controller1Handle, walkingSetHandle, moveHandle, origins );

GetConnectedControllers

int GetConnectedControllers( ControllerHandle_t *handlesOut );
名稱型別說明
handlesOutControllerHandle_t *必須指向一個大小為 STEAM_CONTROLLER_MAX_COUNT 的 ControllerHandle_t 的陣列。

Enumerates currently connected controllers by filling handlesOut with controller handles.

傳回: int
The number of handles written to handlesOut.

範例:
ControllerHandle_t *controllerHandles = new ControllerHandle_t[]; SteamController()->GetConnectedControllers( controllerHandles );

GetControllerForGamepadIndex

ControllerHandle_t GetControllerForGamepadIndex( int nIndex );
名稱型別說明
nIndexint欲取得其控制器控制代碼的模擬手把的索引。

Returns the associated controller handle for the specified emulated gamepad. Can be used with GetInputTypeForHandle to determine the controller type of a controller using Steam Input Gamepad Emulation.

傳回: ControllerHandle_t


範例:
// Replace with the Xinput Slot you are querying for. This number is between 0 and 3 int nXinputSlotIndex = 0; ControllerHandle_t controllerHandle = SteamController()->GetControllerForGamepadIndex( nXinputSlotIndex ); if ( controllerHandle == 0 ) { // Valid handles are non-zero, this is a normal Xbox controller. } else { ESteamInputType inputType = SteamController()->GetInputTypeForHandle(controllerHandle); switch(inputType) { case k_ESteamInputType_Unknown: printf("unknown\n!"); break; case k_ESteamInputType_SteamController: printf("Steam controller\n!"); break; case k_ESteamInputType_XBox360Controller: printf("XBox 360 controller\n!"); break; case k_ESteamInputType_XBoxOneController: printf("XBox One controller\n!"); break; case k_ESteamInputType_GenericXInput: printf("Generic XInput\n!"); break; case k_ESteamInputType_PS4Controller: printf("PS4 controller\n!"); break; } }

GetCurrentActionSet

ControllerActionSetHandle_t GetCurrentActionSet( ControllerHandle_t controllerHandle );
名稱型別說明
controllerHandleControllerHandle_t欲查詢的控制器控制代碼。

Get the currently active action set for the specified controller.

傳回: ControllerActionSetHandle_t
The handle of the action set activated for the specified controller.

範例:
ControllerActionSetHandle_t controller1Set = SteamController()->GetCurrentActionSet(controller1Handle);

GetDigitalActionData

ControllerDigitalActionData_t GetDigitalActionData( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle );
名稱型別說明
controllerHandleControllerHandle_t欲查詢的控制器控制代碼。
digitalActionHandleControllerDigitalActionHandle_t欲查詢的數位動作的控制代碼。

Returns the current state of the supplied digital game action.

傳回: ControllerDigitalActionData_t
The current state of the specified digital action.

GetDigitalActionHandle

ControllerDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName );
名稱型別說明
pszActionNameconst char *遊戲的 VDF 檔中定義的數位動作的識別字串。

Get the handle of the specified digital action.

備註: This function does not take an action set handle parameter. That means that each action in your VDF file must have a unique string identifier. In other words, if you use an action called "up" in two different action sets, this function will only ever return one of them and the other will be ignored.

傳回: ControllerDigitalActionHandle_t
The handle of the specified digital action.

範例:
ControllerDigitalActionHandle_t punchHandle = SteamController()->GetDigitalActionHandle( "punch" );

GetDigitalActionOrigins

int GetDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin *originsOut );
名稱型別說明
controllerHandleControllerHandle_t欲查詢的控制器控制代碼。
actionSetHandleControllerActionSetHandle_t欲查詢的操作組合控制代碼。
digitalActionHandleControllerDigitalActionHandle_tThe handle of the digital action you want to query.
originsOutEControllerActionOrigin *STEAM_CONTROLLER_MAX_ORIGINS 大小的 EControllerActionOrigin 控制代碼陣列。

Get the origin(s) for a digital action within an action set by filling originsOut with EControllerActionOrigin handles. Use this to display the appropriate on-screen prompt for the action.

傳回: int
The number of origins supplied in originsOut.

範例:
EControllerActionOrigin *origins = new EControllerActionOrigin[]; SteamController()->GetDigitalActionOrigins( controller1Handle, fightingSetHandle, punchHandle, origins );

GetGamepadIndexForController

int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle );
名稱型別說明
ulControllerHandleControllerHandle_t欲取得其遊戲手把索引的控制器控制代碼。

Returns the associated gamepad index for the specified controller, if emulating a gamepad.

傳回: int


範例:
int gamepadIndex = SteamController()->GetGamepadIndexForController( controller1Handle );

GetGlyphForActionOrigin

const char * GetGlyphForActionOrigin( EControllerActionOrigin eOrigin );
名稱型別說明
eOriginEControllerActionOrigin

Get a local path to art for on-screen glyph for a particular origin.

傳回: const char *
The path to the png file for the glyph.
E.g. "C:\Program Files (x86)\Steam\tenfoot\resource\images\library\controller\api\ps4_button_x.png"

範例:
// 取得「punch」的來源 EControllerActionOrigin *origins = new EControllerActionOrigin[]; SteamController()->GetDigitalActionOrigins( controller1Handle, fightingSetHandle, punchHandle, origins ); EControllerActionOrigin firstOrigin = origins[0]; //i.e, k_EControllerActionOrigin_PS4_X // 此為遊戲本身的函式,將嘗試取得自訂字符美術檔案 int glyphTextureID = getHardCodedButtonGlyphTexture( firstOrigin ); // 遊戲中沒有附帶這個來源的美術檔案! 我想 Steam 新增了對 // 新控制器的支援,或是我們忘了放入美術檔案! //(我們只有 Steam 控制器字符,但這是 PlasyStation 4 控制器) if( glyphTextureID == -1 ) { // 改為從 Steam 用戶端取的圖片 const char *localGlyphPath = SteamController()->GetGlyphForActionOrigin( firstOrigin ); printf( "path = %s\n", localGlyphPath ); // 「path = C:\Program Files (x86)\Steam\tenfoot\resource\images\library\controller\api\ps4_button_x.png」 // 遊戲本身的函式,可將檔案路徑轉化為可使用的遊戲材質 glyphTextureID = loadButtonGlyphTextureFromLocalPath( localGlyphPath ); }

GetInputTypeForHandle

ESteamInputType GetInputTypeForHandle( ControllerHandle_t controllerHandle );
名稱型別說明
controllerHandleControllerHandle_t欲查詢的輸入類型(裝置型號)的控制器控制代碼。

Returns the input type (device model) for the specified controller. This tells you if a given controller is a Steam controller, XBox 360 controller, PS4 controller, etc. For more details, see Steam's Supported Controller Database.

傳回: ESteamInputType


範例:
ESteamInputType inputType = SteamController()->GetInputTypeForHandle(controller1Handle); switch(inputType) { case k_ESteamInputType_Unknown: printf("unknown\n!"); break; case k_ESteamInputType_SteamController: printf("Steam controller\n!"); break; case k_ESteamInputType_XBox360Controller: printf("XBox 360 controller\n!"); break; case k_ESteamInputType_XBoxOneController: printf("XBox One controller\n!"); break; case k_ESteamInputType_GenericXInput: printf("Generic XInput\n!"); break; case k_ESteamInputType_PS4Controller: printf("PS4 controller\n!"); break; }

GetMotionData

ControllerMotionData_t GetMotionData( ControllerHandle_t controllerHandle );
名稱型別說明
controllerHandleControllerHandle_t欲取得其動作資料的控制器控制代碼。

Returns raw motion data for the specified controller.

傳回: ControllerMotionData_t


範例:
ControllerMotionData_t motionData = SteamController()->GetControllerMotionData( controllerHandle );

GetStringForActionOrigin

const char * GetStringForActionOrigin( EControllerActionOrigin eOrigin );
名稱型別說明
eOriginEControllerActionOrigin

Returns a localized string (from Steam's language setting) for the specified origin.

傳回: const char *


範例:
EControllerActionOrigin *origins = new EControllerActionOrigin[]; SteamController()->GetDigitalActionOrigins( controller1Handle, fightingSetHandle, punchHandle, origins ); const char * punchString = SteamController()->GetStringForActionOrigin( origins[0] ); printf("punch = %s\n",punchString);

Init

bool Init();
Must be called when starting use of the ISteamController interface.

傳回: bool
Always returns true.

範例:
SteamController()->Init();

RunFrame

void RunFrame();
Synchronize API state with the latest Steam Controller inputs available. This is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest possible latency, you can call this directly before reading controller state.

範例:
SteamController()->RunFrame();

SetLEDColor

void SetLEDColor( ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags );
名稱型別說明
controllerHandleControllerHandle_t欲影響的控制器控制代碼。
nColorRuint8設定顏色的紅色部分(0~255)。
nColorGuint8設定顏色的綠色部分(0~255)。
nColorBuint8設定顏色的藍色部分(0~255)。
nFlagsunsigned int位元遮罩旗標加上 ESteamControllerLEDFlag 中定義的值。

Set the controller LED color on supported controllers.

備註:
The VSC does not support any color but white, and will interpret the RGB values as a greyscale value affecting the brightness of the Steam button LED.
The DS4 responds to full color information and uses the values to set the color & brightness of the lightbar.

範例:
// 將控制器 1 回復成使用者預設的顏色: SteamController()->SetLEDColor( controller1Handle, 0, 0, 0, k_ESteamControllerLEDFlag_RestoreUserDefault ); // 將控制器 2 的顏色設定為洋紅色: SteamController()->SetLEDColor( controller2Handle, 255, 0, 255, k_ESteamControllerLEDFlag_SetColor );

ShowAnalogActionOrigins

bool ShowAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition );
名稱型別說明
controllerHandleControllerHandle_t
analogActionHandleControllerAnalogActionHandle_t
flScalefloat
flXPositionfloat
flYPositionfloat

Deprecated.

傳回: bool
Always returns true.

ShowBindingPanel

bool ShowBindingPanel( ControllerHandle_t controllerHandle );
名稱型別說明
controllerHandleControllerHandle_t欲開啟按鍵配置畫面的控制器控制代碼。

Invokes the Steam overlay and brings up the binding screen.

傳回: bool
true for success; false if overlay is disabled/unavailable, or the user is not in Big Picture Mode.

範例:
SteamController()->ShowBindingPanel( myControllerHandle );

ShowDigitalActionOrigins

bool ShowDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle, float flScale, float flXPosition, float flYPosition );
名稱型別說明
controllerHandleControllerHandle_t
digitalActionHandleControllerDigitalActionHandle_t
flScalefloat
flXPositionfloat
flYPositionfloat

Deprecated.

傳回: bool
Always returns true.

Shutdown

bool Shutdown();
Must be called when ending use of the ISteamController interface.

傳回: bool
Always returns true.

範例:
SteamController()->Shutdown();

StopAnalogActionMomentum

void StopAnalogActionMomentum( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction );
名稱型別說明
controllerHandleControllerHandle_t欲影響的控制器控制代碼。
eActionControllerAnalogActionHandle_t欲停止其動量的類比動作。

Stops the momentum of an analog action (where applicable, ie a touchpad w/ virtual trackball settings).

備註:
This will also stop all associated haptics. This is useful for situations where you want to indicate to the user that the limit of an action has been reached, such as spinning a carousel or scrolling a webpage.

範例:
SteamController()->StopAnalogActionMomentum( controller1Handle, moveHandle );

TriggerHapticPulse

void TriggerHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec );
名稱型別說明
controllerHandleControllerHandle_t欲影響的控制器控制代碼。
eTargetPadESteamControllerPad要影響的觸感觸控板。
usDurationMicroSecunsigned short脈衝的持續時間,以微秒(1 / 1,000,000 秒)為單位。

Triggers a (low-level) haptic pulse on supported controllers.

備註:
Currently only the VSC supports haptic pulses.
This API call will be ignored for all other controller models.
The typical max value of an unsigned short is 65535, which means the longest haptic pulse you can trigger with this method has a duration of 0.065535 seconds (ie, less than 1/10th of a second). This function should be thought of as a low-level primitive meant to be repeatedly used in higher-level user functions to generate more sophisticated behavior.

範例:
// 進行一次 1 / 20 秒的脈衝 SteamController()->TriggerHapticPulse(controller1Handle, k_ESteamControllerPad_Left, 50000);

TriggerRepeatedHapticPulse

void TriggerRepeatedHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags );
名稱型別說明
controllerHandleControllerHandle_t欲影響的控制器控制代碼。
eTargetPadESteamControllerPad要影響的觸感觸控板。
usDurationMicroSecunsigned short脈衝的持續時間,以微秒(1 / 1,000,000 秒)為單位。
usOffMicroSecunsigned short脈衝間隔的持續時間,以微秒為單位。
unRepeatunsigned short重複 usDurationMicroSec / usOffMicroSec 工作週期的次數。
nFlagsunsigned int目前未使用,將保留至未來使用。

Triggers a repeated haptic pulse on supported controllers.

備註:
Currently only the VSC supports haptic pulses.
This API call will be ignored for incompatible controller models.
This is a more user-friendly function to call than TriggerHapticPulse as it can generate pulse patterns long enough to be actually noticed by the user.
Changing the usDurationMicroSec and usOffMicroSec parameters will change the "texture" of the haptic pulse.

範例:
// 以每 1/20 秒為間隔開 / 關脈衝的方式,發送 1 秒的脈衝 SteamController()->TriggerRepeatedHapticPulse( controller1Handle, k_ESteamControllerPad_Left, 50000, 50000, 10 );

TriggerVibration

void TriggerVibration( ControllerHandle_t controllerHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed );
名稱型別說明
controllerHandleControllerHandle_t欲影響的控制器控制代碼。
usLeftSpeedunsigned shortThe intensity value for the left rumble motor.
usRightSpeedunsigned shortThe intensity value of the right rumble motor.

Trigger a vibration event on supported controllers.

備註:
This API call will be ignored for incompatible controller models.
This generates the traditional "rumble" vibration effect.
The VSC will emulate traditional rumble using its haptics.

範例:
SteamController()->TriggerVibration( controller1Handle, 10000, 10000 );

GetActionOriginFromXboxOrigin

EControllerActionOrigin GetActionOriginFromXboxOrigin( ControllerHandle_t controllerHandle, EXboxOrigin eOrigin );
名稱型別說明
controllerHandleControllerHandle_tThe handle of the controller to affect. You can use GetControllerForGamepadIndex to get this handle
eOriginEXboxOriginThis is the button you want to get the image for ex: k_EXboxOrigin_A

Returns: EControllerActionOrigin

Get an action origin that you can use in your glyph look up table or passed into GetGlyphForActionOrigin or GetStringForActionOrigin


Example:
int nXinputSlot = 1; // Substitute whatever the correct Xinput slot is for your player ControllerHandle_t controller1Handle = GetControllerForGamepadIndex( nXinputSlot ); EControllerActionOrigin buttonOrigin = SteamController()->GetActionOriginFromXboxOrigin( controller1Handle, k_EXboxOrigin_A ); // Get the image from the Steam client . const char *localGlyphPath = SteamController()->GetGlyphForActionOrigin( buttonOrigin ); printf( "path = %s\n", localGlyphPath ); // "path = C:\Program Files (x86)\Steam\tenfoot\resource\images\library\controller\api\ps4_button_x.png" //a function from the game that turns a file path into a usable game texture glyphTextureID = loadButtonGlyphTextureFromLocalPath( localGlyphPath );

TranslateActionOrigin

EControllerActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin );
名稱型別說明
controllerHandleControllerHandle_tThe handle of the controller to affect. You can use GetControllerForGamepadIndex to get this handle
eDestinationInputTypeESteamInputTypeThe controller type you want to translate to. Steam will pick the closest type from your SDK version if k_ESteamInputType_Unknown is used
eSourceOriginEControllerActionOriginThis is the button you want to translate

Returns: EControllerActionOrigin

Get the equivalent origin for a given controller type or the closest controller type that existed in the SDK you built into your game if eDestinationInputType is k_ESteamInputType_Unknown. This action origin can be used in your glyph look up table or passed into GetGlyphForActionOrigin or GetStringForActionOrigin


Example:
int nXinputSlot = 1; // Substitute whatever the correct Xinput slot is for your player ControllerHandle_t controller1Handle = GetControllerForGamepadIndex( nXinputSlot ); EControllerActionOrigin buttonOrigin = SteamController()->GetActionOriginFromXboxOrigin( controller1Handle, k_EXboxOrigin_A ); //i.e, k_EControllerActionOrigin_PS4_X if ( buttonOrigin >= k_EControllerActionOrigin_Count ) { // We didn't ship any art in our game for this origin! 我想 Steam 已新增了 // 對一個新控制器的支援。 Let's get the closest value that was supported by the SDK we built against buttonOrigin = SteamController()->TranslateActionOrigin( k_ESteamInputType_Unknown, buttonOrigin ) } // This is a function from the game itself that tries to get custom glyph art int glyphTextureID = getHardCodedButtonGlyphTexture( actionOrigin );

GetControllerBindingRevision

bool GetControllerBindingRevision( ControllerHandle_t controllerHandle, int *pMajor, int *pMinor );
名稱型別說明
controllerHandleControllerHandle_t欲查詢的控制器控制代碼。
pMajorint * 重大按鍵配置修訂將填入的 int 指標。
pMinorint * 小型按鍵配置修訂將填入的 int 指標。

傳回: bool - 如果成功找到裝置的按鍵配置,則為 true;如果按鍵配置仍在載入,則為 false。

Get's the major and minor device binding revisions for Steam Input API configurations. Minor revisions are for small changes such as adding a new option action or updating localization in the configuration. 為小型修訂進行更新時,只需要使用「使用動作區塊」旗標集更新一個新配置即可。 Major revisions are to be used when changing the number of action sets or otherwise reworking configurations to the degree that older configurations are no longer usable. When a user's binding disagree's with the major revision of the current official configuration Steam will forcibly update the user to the new configuration. New configurations will need to be made for every controller when updating the Major revision.

程式碼範例:
int nMinor = -1; int nMinor = -1; const int nCurrentMajorRevision = 1; const int nCurrentMinorRevision = 1; if ( GetControllerBindingRevision( controllerHandle, &nMajor, &nMinor ) ) { if ( nMinorRevision != nCurrentMinorRevision ) { // 小型版本過期,但仍可用 // 下次編輯配置時將會修正 } if ( nMajorRevision != nCurrentMajorRevision ) { // 應只在 Steam 偵測到時短暫出現 // 然後強制將使用者更新至最新的官方配置 } } else { // 尚未為此控制器載入該配置 }

遊戲內動作檔案使用範例:
"In Game Actions" { "major_revision" "0" “minor_revision” “1” "actions" { ...

結構

以下為 ISteamController 中的函式可能會傳回或與之互動的結構。

ControllerAnalogActionData_t

表示類比動作目前的狀態。

備註:
  • 確切的值、範圍等取決於設定方式,但是(大致來說)傳統的類比動作將提供約在 -1.0 到 1.0 之內的標準浮點值,而類似滑鼠的動作將提供增量更新,代表上一幀開始移動的「像素」數量。 這樣做的結果是,類似滑鼠的動作將提供更大的絕對 x 和 y 值、基準為上次渲染的輸入位置,而傳統的類比動作提供的值較小、基準為中央物理錨點。
  • 雖然由類似滑鼠動作提供的增量與作業系統提供的像素增量非常相似,但 SC 增量是浮點數,而不是整數。 這代表將此資料對應至相機旋轉時,會導致潛在量化的減少與精準度的降低。
  • 在單軸類比輸入(例如類比板機索引碼)的情況下,只有 X 軸會包含資料;Y 軸永遠為 0。

名稱型別說明
eModeEControllerSourceMode來自該動作的資料類型,將與操作組合的 VDF 定義中指定的類型相符。
xfloat此動作目前在水平軸上的狀態。
yfloat此動作目前在垂直軸上的狀態。
bActivebool此動作目前是否可以綁定至使用中的操作組合。 如果不行,「或」不屬於使用中的操作組合,則為 false。

ControllerDigitalActionData_t

代表數位動作目前的狀態。

名稱型別說明
bStatebool此動作目前的狀態;若此動作目前被按下,為 true,反之則為 false
bActivebool此動作目前是否可以綁定至使用中的操作組合。

ControllerMotionData_t

代表裝置的動態感應器目前的狀態。

備註: 如果是 rotQuatX / rotQuatY / rotQuatZ,控制器的慣性測量單元將建立一個融合陀螺儀和加速計的四元數。 此值為控制器的絕對方位,但會在偏航(yaw)軸上漂移。

名稱型別說明
rotQuatXfloat融合感應器的絕對旋轉(其航向將漂移),X 軸。
rotQuatYfloat融合感應器的絕對旋轉(其航向將漂移),Y 軸。
rotQuatZfloat融合感應器的絕對旋轉(其航向將漂移),Z 軸。
rotQuatWfloat融合感應器的絕對旋轉(其航向將漂移),W 軸。
posAccelXfloat位置性加速度,X 軸。
posAccelYfloat位置性加速度,Y 軸。
posAccelZfloat位置性加速度,Z 軸。
rotVelXfloat角速度,X 軸。
rotVelYfloat角速度,Y 軸。
rotVelZfloat角速度,Z 軸。

列舉

以下為定義來用於 ISteamController 中的列舉。

EControllerActionOrigin

玩家在 Steam 輸入設定器中為動作綁定的輸入。 這些值的主要目的是為指定動作在畫面上顯示按鈕字符,如「按 [A] 跳躍」。

名稱說明
k_EControllerActionOrigin_None0
k_EControllerActionOrigin_A1(Valve Steam 控制器)數位正面按鍵 A。
k_EControllerActionOrigin_B2(Valve Steam 控制器)數位正面按鍵 B
k_EControllerActionOrigin_X3(Valve Steam 控制器)數位正面按鍵 X。
k_EControllerActionOrigin_Y4(Valve Steam 控制器)數位正面按鍵 Y。
k_EControllerActionOrigin_LeftBumper5(Valve Steam Controller) digital left shoulder button (aka "left bumper")
k_EControllerActionOrigin_RightBumper6(Valve Steam Controller) digital right shoulder button (aka "right bumper")
k_EControllerActionOrigin_LeftGrip7(Valve Steam 控制器)數位左握持鍵。
k_EControllerActionOrigin_RightGrip8(Valve Steam 控制器)數位右握持鍵。
k_EControllerActionOrigin_Start9(Valve Steam 控制器)數位 Start 鍵。
k_EControllerActionOrigin_Back10(Valve Steam 控制器)數位 Back 鍵。
k_EControllerActionOrigin_LeftPad_Touch11(Valve Steam 控制器)左觸感回饋觸控板,簡單的單指觸碰。
k_EControllerActionOrigin_LeftPad_Swipe12(Valve Steam 控制器)左觸感回饋觸控板,任何軸上的觸碰輸入。
k_EControllerActionOrigin_LeftPad_Click13(Valve Steam 控制器)左觸感回饋觸控板,(整面的)數位點擊。
k_EControllerActionOrigin_LeftPad_DPadNorth14(Valve Steam 控制器)左觸感回饋觸控板,(上方四分之一的)數位點擊。
k_EControllerActionOrigin_LeftPad_DPadSouth15(Valve Steam 控制器)左觸感回饋觸控板,(下方四分之一的)數位點擊。
k_EControllerActionOrigin_LeftPad_DPadWest16(Valve Steam 控制器)左觸感回饋觸控板,(左方四分之一的)數位點擊。
k_EControllerActionOrigin_LeftPad_DPadEast17(Valve Steam 控制器)左觸感回饋觸控板,(右方四分之一的)數位點擊。
k_EControllerActionOrigin_RightPad_Touch18(Valve Steam 控制器)右觸感回饋觸控板,簡單的單指觸碰。
k_EControllerActionOrigin_RightPad_Swipe19(Valve Steam 控制器)右觸感回饋觸控板,任何軸上的觸碰輸入。
k_EControllerActionOrigin_RightPad_Click20(Valve Steam 控制器)右觸感回饋觸控板,(整面的)數位點擊。
k_EControllerActionOrigin_RightPad_DPadNorth21(Valve Steam 控制器)右觸感回饋觸控板,(上方四分之一的)數位點擊。
k_EControllerActionOrigin_RightPad_DPadSouth22(Valve Steam 控制器)右觸感回饋觸控板,(下方四分之一的)數位點擊。
k_EControllerActionOrigin_RightPad_DPadWest23(Valve Steam 控制器)右觸感回饋觸控板,(左方四分之一的)數位點擊。
k_EControllerActionOrigin_RightPad_DPadEast24(Valve Steam 控制器)右觸感回饋觸控板,(右方四分之一的)數位點擊。
k_EControllerActionOrigin_LeftTrigger_Pull25(Valve Steam 控制器)左類比板機鍵,任何力度(類比值)的拉扣。
k_EControllerActionOrigin_LeftTrigger_Click26(Valve Steam 控制器)左類比板機鍵,拉扣到底(數位值)。
k_EControllerActionOrigin_RightTrigger_Pull27(Valve Steam 控制器)右類比板機鍵,任何力度(類比值)的拉扣。
k_EControllerActionOrigin_RightTrigger_Click28(Valve Steam 控制器)右類比板機鍵,拉扣到底(數位值)。
k_EControllerActionOrigin_LeftStick_Move29(Valve Steam 控制器)左搖桿,任何軸上的動作(類比值)。
k_EControllerActionOrigin_LeftStick_Click30(Valve Steam 控制器)左搖桿,按下(數位值)。
k_EControllerActionOrigin_LeftStick_DPadNorth31(Valve Steam 控制器)左搖桿,數位動作(上方四分之一)。
k_EControllerActionOrigin_LeftStick_DPadSouth32(Valve Steam 控制器)左搖桿,數位動作(下方四分之一)。
k_EControllerActionOrigin_LeftStick_DPadWest33(Valve Steam 控制器)左搖桿,數位動作(左方四分之一)。
k_EControllerActionOrigin_LeftStick_DPadEast34(Valve Steam 控制器)左搖桿,數位動作(右方四分之一)。
k_EControllerActionOrigin_Gyro_Move35(Valve Steam 控制器)陀螺儀,任何軸上的類比動作。
k_EControllerActionOrigin_Gyro_Pitch36(Valve Steam 控制器)陀螺儀,俯仰軸(前端指向上方天花板或下方地面)上的類比動作。
k_EControllerActionOrigin_Gyro_Yaw37(Valve Steam 控制器)陀螺儀,偏航軸(前端指向左方牆壁或朝右指向另一邊)上的類比動作。
k_EControllerActionOrigin_Gyro_Roll38(Valve Steam 控制器)陀螺儀,翻滾軸(前端往左肩傾斜,或往右方另一邊傾斜)上的類比動作。
k_EControllerActionOrigin_PS4_X39(Sony Dualshock 4)數位正面按鍵 ╳。
k_EControllerActionOrigin_PS4_Circle40(Sony Dualshock 4)數位正面按鍵 〇。
k_EControllerActionOrigin_PS4_Triangle41(Sony Dualshock 4)數位正面按鍵 △。
k_EControllerActionOrigin_PS4_Square42(Sony Dualshock 4)數位正面按鍵 □。
k_EControllerActionOrigin_PS4_LeftBumper43(Sony Dualshock 4) digital left shoulder button (aka "left bumper")
k_EControllerActionOrigin_PS4_RightBumper44(Sony Dualshock 4) digital right shoulder button (aka "right bumper")
k_EControllerActionOrigin_PS4_Options45(Sony Dualshock 4) digital options button (aka "Start")
k_EControllerActionOrigin_PS4_Share46(Sony Dualshock 4) digital share button (aka "Back")
k_EControllerActionOrigin_PS4_LeftPad_Touch47(Sony Dualshock 4)觸控板左半部,簡單的單指觸碰。
k_EControllerActionOrigin_PS4_LeftPad_Swipe48(Sony Dualshock 4)觸控板左半部,任何軸上的觸碰輸入。
k_EControllerActionOrigin_PS4_LeftPad_Click49(Sony Dualshock 4)觸控板左半部,(整面的)數位點擊。
k_EControllerActionOrigin_PS4_LeftPad_DPadNorth50(Sony Dualshock 4)觸控板左半部,(上方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_LeftPad_DPadSouth51(Sony Dualshock 4)觸控板左半部,(下方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_LeftPad_DPadWest52(Sony Dualshock 4)觸控板左半部,(左方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_LeftPad_DPadEast53(Sony Dualshock 4)觸控板左半部,(右方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_RightPad_Touch54(Sony Dualshock 4)觸控板右半部,簡單的單指觸碰。
k_EControllerActionOrigin_PS4_RightPad_Swipe55(Sony Dualshock 4)觸控板右半部,任何軸上的觸碰輸入。
k_EControllerActionOrigin_PS4_RightPad_Click56(Sony Dualshock 4)觸控板右半部,(整面的)數位點擊。
k_EControllerActionOrigin_PS4_RightPad_DPadNorth57(Sony Dualshock 4)觸控板右半部,(上方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_RightPad_DPadSouth58(Sony Dualshock 4)觸控板右半部,(下方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_RightPad_DPadWest59(Sony Dualshock 4)觸控板右半部,(左方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_RightPad_DPadEast60(Sony Dualshock 4)觸控板右半部,(右方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_CenterPad_Touch61(Sony Dualshock 4)觸控板整體,簡單的單指觸碰。
k_EControllerActionOrigin_PS4_CenterPad_Swipe62(Sony Dualshock 4)觸控板整體,任何軸上的觸碰輸入。
k_EControllerActionOrigin_PS4_CenterPad_Click63(Sony Dualshock 4)觸控板整體,(整面的)數位點擊。
k_EControllerActionOrigin_PS4_CenterPad_DPadNorth64(Sony Dualshock 4)觸控板整體,(上方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_CenterPad_DPadSouth65(Sony Dualshock 4)觸控板整體,(下方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_CenterPad_DPadWest66(Sony Dualshock 4)觸控板整體,(左方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_CenterPad_DPadEast67(Sony Dualshock 4)觸控板整體,(右方四分之一的)數位點擊。
k_EControllerActionOrigin_PS4_LeftTrigger_Pull68(Sony Dualshock 4)左類比板機鍵,任何力度(類比值)的拉扣。
k_EControllerActionOrigin_PS4_LeftTrigger_Click69(Sony Dualshock 4)左類比板機鍵,拉扣到底(數位值)。
k_EControllerActionOrigin_PS4_RightTrigger_Pull70(Sony Dualshock 4)右類比板機鍵,任何力度(類比值)的拉扣。
k_EControllerActionOrigin_PS4_RightTrigger_Click71(Sony Dualshock 4)右類比板機鍵,拉扣到底(數位值)。
k_EControllerActionOrigin_PS4_LeftStick_Move72(Sony Dualshock 4)左搖桿,任何軸上的動作(類比值)。
k_EControllerActionOrigin_PS4_LeftStick_Click73(Sony Dualshock 4)左搖桿,按下(數位值)。
k_EControllerActionOrigin_PS4_LeftStick_DPadNorth74(Sony Dualshock 4)左搖桿,數位動作(上方四分之一)。
k_EControllerActionOrigin_PS4_LeftStick_DPadSouth75(Sony Dualshock 4)左搖桿,數位動作(下方四分之一)。
k_EControllerActionOrigin_PS4_LeftStick_DPadWest76(Sony Dualshock 4)左搖桿,數位動作(左方四分之一)。
k_EControllerActionOrigin_PS4_LeftStick_DPadEast77(Sony Dualshock 4)左搖桿,數位動作(右方四分之一)。
k_EControllerActionOrigin_PS4_RightStick_Move78(Sony Dualshock 4)右搖桿,任何軸上的動作(類比值)。
k_EControllerActionOrigin_PS4_RightStick_Click79(Sony Dualshock 4)右搖桿,按下(數位值)。
k_EControllerActionOrigin_PS4_RightStick_DPadNorth80(Sony Dualshock 4)右搖桿,數位動作(上方四分之一)。
k_EControllerActionOrigin_PS4_RightStick_DPadSouth81(Sony Dualshock 4)右搖桿,數位動作(下方四分之一)。
k_EControllerActionOrigin_PS4_RightStick_DPadWest82(Sony Dualshock 4)右搖桿,數位動作(左方四分之一)。
k_EControllerActionOrigin_PS4_RightStick_DPadEast83(Sony Dualshock 4)右搖桿,數位動作(右方四分之一)。
k_EControllerActionOrigin_PS4_DPad_North84(Sony Dualshock 4)數位面板,(上方四分之一的)按壓。
k_EControllerActionOrigin_PS4_DPad_South85(Sony Dualshock 4)數位板,(下方四分之一的)按壓。
k_EControllerActionOrigin_PS4_DPad_West86(Sony Dualshock 4)數位板,(左方四分之一的)按壓。
k_EControllerActionOrigin_PS4_DPad_East87(Sony Dualshock 4)數位板,(右方四分之一的)按壓。
k_EControllerActionOrigin_PS4_Gyro_Move88(Sony Dualshock 4)陀螺儀,任何軸上的類比動作。
k_EControllerActionOrigin_PS4_Gyro_Pitch89(Sony Dualshock 4)陀螺儀,俯仰軸(前端指向上方天花板或下方地面)上的類比動作。
k_EControllerActionOrigin_PS4_Gyro_Yaw90(Sony Dualshock 4)陀螺儀,偏航軸(前端指向左方牆壁或朝右指向另一邊)上的類比動作。
k_EControllerActionOrigin_PS4_Gyro_Roll91(Sony Dualshock 4)陀螺儀,翻滾軸(前端往左肩傾斜,或往右方另一邊傾斜)上的類比動作。
k_EControllerActionOrigin_XBoxOne_A92(XB1)數位正面按鍵 A。
k_EControllerActionOrigin_XBoxOne_B93(XB1)數位正面按鍵 B。
k_EControllerActionOrigin_XBoxOne_X94(XB1)數位正面按鍵 X。
k_EControllerActionOrigin_XBoxOne_Y95(XB1)數位正面按鍵 Y。
k_EControllerActionOrigin_XBoxOne_LeftBumper96(XB1) digital left shoulder button (aka "left bumper")
k_EControllerActionOrigin_XBoxOne_RightBumper97(XB1) digital right shoulder button (aka "right bumper")
k_EControllerActionOrigin_XBoxOne_Menu98(XB1) digital menu button (aka "start")
k_EControllerActionOrigin_XBoxOne_View99(XB1) digital view button (aka "back")
k_EControllerActionOrigin_XBoxOne_LeftTrigger_Pull100(XB1)左類比板機鍵,任何力度(類比值)的拉扣。
k_EControllerActionOrigin_XBoxOne_LeftTrigger_Click101(XB1)左類比板機鍵,拉扣到底(數位值)。
k_EControllerActionOrigin_XBoxOne_RightTrigger_Pull102(XB1)右類比板機鍵,任何力度(類比值)的拉扣。
k_EControllerActionOrigin_XBoxOne_RightTrigger_Click103(XB1)右類比板機鍵,拉扣到底(數位值)。
k_EControllerActionOrigin_XBoxOne_LeftStick_Move104(XB1)左搖桿,任何軸上的動作(類比值)。
k_EControllerActionOrigin_XBoxOne_LeftStick_Click105(XB1)左搖桿,按下(數位值)。
k_EControllerActionOrigin_XBoxOne_LeftStick_DPadNorth106(XB1)左搖桿,數位動作(上方四分之一)。
k_EControllerActionOrigin_XBoxOne_LeftStick_DPadSouth107(XB1)左搖桿,數位動作(下方四分之一)。
k_EControllerActionOrigin_XBoxOne_LeftStick_DPadWest108(XB1)左搖桿,數位動作(左方四分之一)。
k_EControllerActionOrigin_XBoxOne_LeftStick_DPadEast109(XB1)左搖桿,數位動作(右方四分之一)。
k_EControllerActionOrigin_XBoxOne_RightStick_Move110(XB1)右搖桿,任何軸上的動作(類比值)。
k_EControllerActionOrigin_XBoxOne_RightStick_Click111(XB1)右搖桿,按下(數位值)。
k_EControllerActionOrigin_XBoxOne_RightStick_DPadNorth112(XB1)右搖桿,數位動作(上方四分之一)。
k_EControllerActionOrigin_XBoxOne_RightStick_DPadSouth113(XB1)右搖桿,數位動作(下方四分之一)。
k_EControllerActionOrigin_XBoxOne_RightStick_DPadWest114(XB1)右搖桿,數位動作(左方四分之一)。
k_EControllerActionOrigin_XBoxOne_RightStick_DPadEast115(XB1)右搖桿,數位動作(右方四分之一)。
k_EControllerActionOrigin_XBoxOne_DPad_North116(XB1)數位板,(上方四分之一的)按壓。
k_EControllerActionOrigin_XBoxOne_DPad_South117(XB1)數位板,(下方四分之一的)按壓。
k_EControllerActionOrigin_XBoxOne_DPad_West118(XB1)數位板,(左方四分之一的)按壓。
k_EControllerActionOrigin_XBoxOne_DPad_East119(XB1)數位板,(右方四分之一的)按壓。
k_EControllerActionOrigin_XBox360_A120(X360)數位正面按鍵 A。
k_EControllerActionOrigin_XBox360_B121(X360)數位正面按鍵 B。
k_EControllerActionOrigin_XBox360_X122(X360)數位正面按鍵 X。
k_EControllerActionOrigin_XBox360_Y123(X360)數位正面按鍵 Y。
k_EControllerActionOrigin_XBox360_LeftBumper124(X360) digital left shoulder button (aka "left bumper")
k_EControllerActionOrigin_XBox360_RightBumper125(X360) digital right shoulder button (aka "right bumper")
k_EControllerActionOrigin_XBox360_Start126(X360)數位 Start 鍵。
k_EControllerActionOrigin_XBox360_Back127(X360)數位 Back 鍵。
k_EControllerActionOrigin_XBox360_LeftTrigger_Pull128(X360)左類比板機鍵,任何力度(類比值)的拉扣。
k_EControllerActionOrigin_XBox360_LeftTrigger_Click129(X360)左類比板機鍵,拉扣到底(數位值)。
k_EControllerActionOrigin_XBox360_RightTrigger_Pull130(X360)右類比板機鍵,任何力度(類比值)的拉扣。
k_EControllerActionOrigin_XBox360_RightTrigger_Click131(X360)右類比板機鍵,拉扣到底(數位值)。
k_EControllerActionOrigin_XBox360_LeftStick_Move132(X360)左搖桿,任何軸上的動作(類比值)。
k_EControllerActionOrigin_XBox360_LeftStick_Click133(X360)左搖桿,按下(數位值)。
k_EControllerActionOrigin_XBox360_LeftStick_DPadNorth134(X360)左搖桿,數位動作(上方四分之一)。
k_EControllerActionOrigin_XBox360_LeftStick_DPadSouth135(X360)左搖桿,數位動作(下方四分之一)。
k_EControllerActionOrigin_XBox360_LeftStick_DPadWest136(X360)左搖桿,數位動作(左方四分之一)。
k_EControllerActionOrigin_XBox360_LeftStick_DPadEast137(X360)左搖桿,數位動作(右方四分之一)。
k_EControllerActionOrigin_XBox360_RightStick_Move138(X360)右搖桿,任何軸上的動作(類比值)。
k_EControllerActionOrigin_XBox360_RightStick_Click139(X360)右搖桿,按下(數位值)。
k_EControllerActionOrigin_XBox360_RightStick_DPadNorth140(X360)右搖桿,數位動作(上方四分之一)。
k_EControllerActionOrigin_XBox360_RightStick_DPadSouth141(X360)右搖桿,數位動作(下方四分之一)。
k_EControllerActionOrigin_XBox360_RightStick_DPadWest142(X360)右搖桿,數位動作(左方四分之一)。
k_EControllerActionOrigin_XBox360_RightStick_DPadEast143(X360)右搖桿,數位動作(右方四分之一)。
k_EControllerActionOrigin_XBox360_DPad_North144(X360)數位板,(上方四分之一的)按壓。
k_EControllerActionOrigin_XBox360_DPad_South145(X360)數位板,(下方四分之一的)按壓。
k_EControllerActionOrigin_XBox360_DPad_West146(X360)數位板,(左方四分之一的)按壓。
k_EControllerActionOrigin_XBox360_DPad_East147(X360)數位板,(右方四分之一的)按壓。
k_EControllerActionOrigin_Count196此列舉中的值的數量,可用來逐一查看。

EControllerSource

將控制器上的一塊區域視為一個較大的抽象模組單位,可對其套用多種模式,並輸出有用的資料。 例如,搖桿可以被當作單個類比輸入,或分為四個離散的數位輸入,組成虛擬方向鍵。 同樣地,ABXY 正面按鍵也自成一組,可作為四個獨立按鈕,或者虛擬方向件的元件等等。

NameValueDescription
k_EControllerSource_None0No controller source.
k_EControllerSource_LeftTrackpad1The left touchpad, or the left half of a central touchpad.
k_EControllerSource_RightTrackpad2The right touchpad, or the right half of a central touchpad.
k_EControllerSource_Joystick3The joystick, or if there is more than one joystick, the left joystick.
k_EControllerSource_ABXY4The four main face buttons.
k_EControllerSource_Switch5Switches/buttons on the controller that don't belong to any other specific source. This includes bumpers, start/select, and grips. This special case of misfits don't fit into the larger paradigm and thus get their own source of digital buttons and a corresponding mode that processes them.
k_EControllerSource_LeftTrigger6The left analog trigger.
k_EControllerSource_RightTrigger7The right analog trigger.
k_EControllerSource_Gyro8The internal gyroscope.
k_EControllerSource_CenterTrackpad9The central touchpad. (DS4 only)
k_EControllerSource_RightJoystick10The right joystick. If there is only one joystick, this source is not used.
k_EControllerSource_DPad11The digital pad.
k_EControllerSource_Key12Keyboard key (for keyboards with scan codes).
k_EControllerSource_Mouse13Traditional mouse
k_EControllerSource_Count14The number of enums, useful for iterating.

EControllerSourceMode

The virtual input mode imposed by the configurator upon a controller source. For instance, the configurator can make an analog joystick behave like a Dpad with four digital inputs; the EControllerSource would be k_EControllerSource_Joystick and the EControllerSourceMode would be k_EControllerSourceMode_Dpad. The mode also changes the input data received by any associated actions.

NameValueDescription
k_EControllerSourceMode_None0No input mode.
k_EControllerSourceMode_Dpad1A digital pad -- four digital directional buttons fused together in a cross pattern, such that only one button from each axis can be pressed at any given time.
k_EControllerSourceMode_Buttons2
k_EControllerSourceMode_FourButtons3四個數位正面按鍵,每個皆可同時按下。
k_EControllerSourceMode_AbsoluteMouse4
k_EControllerSourceMode_RelativeMouse5
k_EControllerSourceMode_JoystickMove6
k_EControllerSourceMode_JoystickMouse7
k_EControllerSourceMode_JoystickCamera8
k_EControllerSourceMode_ScrollWheel9
k_EControllerSourceMode_Trigger10
k_EControllerSourceMode_TouchMenu11
k_EControllerSourceMode_MouseJoystick12
k_EControllerSourceMode_MouseRegion13
k_EControllerSourceMode_RadialMenu14
k_EControllerSourceMode_SingleButton15
k_EControllerSourceMode_Switches16

ESteamControllerLEDFlag

控制 Steam 控制器裝置的 LED 顏色(若適用)。

備註:
VSC 具 LED,但只能更改其亮度(顏色永遠為白色)。
DS4 的 LED 為燈條,其顏色和亮度皆可設定。

NameValueDescription
k_ESteamControllerLEDFlag_SetColor0Set the color to the specified values
k_ESteamControllerLEDFlag_RestoreUserDefault1Restore the color to default (out-of-game) settings

ESteamInputType

代表指定的硬體的裝置型號。

NameValueDescription
k_ESteamInputType_Unknown0Catch-all for unrecognized devices
k_ESteamInputType_SteamController1Valve's Steam Controller
k_ESteamInputType_XBox360Controller2Microsoft's XBox 360 Controller
k_ESteamInputType_XBoxOneController3Microsoft's XBox One Controller
k_ESteamInputType_GenericXInput4Any generic 3rd-party XInput device
k_ESteamInputType_PS4Controller5Sony's Playstation 4 Controller
k_ESteamInputType_AppleMFiController6Unused
k_ESteamInputType_AndroidController7Unused
k_ESteamInputType_SwitchJoyConPair8Unused
k_ESteamInputType_SwitchJoyConSingle9Unused
k_ESteamInputType_SwitchProController10Nintendo Switch Pro 控制器
k_ESteamInputType_MobileTouch11Steam Link App's Mobile Touch Controller
k_ESteamInputType_PS3Controller12Sony's Playstation 3 Controller or PS3/PS4 compatible fight stick
k_ESteamInputType_Count13Current number of values returned
k_ESteamInputType_MaximumPossibleValue255傳回的可能的最大值。

ESteamControllerPad

Steam 控制器裝置上的觸控板區域。

備註:
在 VSC 上這些值對應到左右觸感回饋觸控板。
在 DS4 上這些值對應到單一的中央觸控板的左右兩半。

名稱說明
k_ESteamControllerPad_Left0Steam 控制器裝置上的左觸控板區域。 相容模型:VSC, DS4
k_ESteamControllerPad_Right1Steam 控制器裝置上的右觸控板區域。 相容模型:VSC, DS4

Typedefs

以下為定義來用於 ISteamController 中的 typedefs 。

名稱基礎型別說明
ControllerActionSetHandle_tuint64這些控制代碼用來代表指定的遊戲內動作或操作組合。
基於效能的考量,在初始化期間應查詢所有操作控制代碼。
ControllerAnalogActionHandle_tuint64類比動作的控制代碼。 可由 GetAnalogActionHandle 取得。
ControllerDigitalActionHandle_tuint64數位動作的控制代碼。 可由 GetDigitalActionHandle 取得。
ControllerHandle_tuint64即使此控制代碼斷線後再連線,也會持續地辨識控制器。

常數

以下為定義來用於 ISteamController 中的常數。

名稱型別說明
STEAMCONTROLLER_INTERFACE_VERSIONconst char *"SteamController007"
STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERSintUINT64_MAX傳送一個選項至特定的控制器控制代碼時,您可使用此特殊的值來代替控制代碼,改將該選項傳送至所有控制器。
STEAM_CONTROLLER_MAX_ANALOG_ACTIONSint16可於各控制器上執行的最大類比操作數量。
STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATAfloat1.0f類比操作在任一軸上可回報的最大值。
STEAM_CONTROLLER_MAX_COUNTint16可同時與 Steam 輸入設定器一起使用的控制器的最大數量。
STEAM_CONTROLLER_MAX_DIGITAL_ACTIONSint128可於各控制器上執行的最大數位操作數量。
STEAM_CONTROLLER_MAX_ORIGINSint8可附加至單一操作上的最多輸入源頭數量。
STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATAfloat-1.0f類比操作在任一軸上可回報的最小值。