API введення Steam — гнучкий, заснований на діях інтерфейс, що підтримує всі основні типи контролерів: Xbox, PlayStation, Nintendo Switch Pro та контролери Steam.
Для докладнішої інформації перегляньте документацію «
Введення Steam».
Функції-члени
Функції-члени для
ISteamInput
викликаються за допомогою глобальної функції доступу
SteamInput()
.
ActivateActionSet
void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, для якого потрібно активувати набір дій. |
actionSetHandle | InputActionSetHandle_t | Дескриптор набору дій, який потрібно активувати. |
Змінює конфігурацію контролера для використання вказаного набору дій (наприклад, «Menu», «Walk» чи «Drive» для дії «Меню», «Йти» чи «Водіння», відповідно).
Не вимагає багато ресурсів, і її можна безпечно викликати повторно. Зазвичай простіше регулярно викликати її в циклах стану, аніж намагатися встановити у всі переходи стану.
Приклад:void updateStateLoop()
{
switch( currentState )
{
case MENU:
SteamInput()->ActivateActionSet( inputHandle1, menuSetHandle );
doMenuStuff();
break;
case WALKING:
SteamInput()->ActivateActionSet( inputHandle1, walkingSetHandle );
doWalkingStuff();
break;
case DRIVING:
SteamInput()->ActivateActionSet( inputHandle1, drivingSetHandle );
doDrivingStuff();
break;
case FIGHTING:
SteamInput()->ActivateActionSet( inputHandle1, fightingSetHandle );
doFightingStuff();
break;
}
}
Активація всіх контролерів
Часто вам може знадобитися активувати всі контролери одночасно, а не по одному. Для цього слід використовувати константу
STEAM_INPUT_HANDLE_ALL_CONTROLLERS як дескриптор контролерів. Ви також можете використовувати це значення в будь-якій функції, що викликає дескриптор окремого контролера.
Приклад:void updateStateLoop()
{
switch( currentState )
{
case MENU:
SteamInput()->ActivateActionSet( STEAM_INPUT_HANDLE_ALL_CONTROLLERS, menuSetHandle );
doMenuStuff();
break;
case WALKING:
SteamInput()->ActivateActionSet( STEAM_INPUT_HANDLE_ALL_CONTROLLERS, walkingSetHandle );
doWalkingStuff();
break;
case DRIVING:
SteamInput()->ActivateActionSet( STEAM_INPUT_HANDLE_ALL_CONTROLLERS, drivingSetHandle );
doDrivingStuff();
break;
case FIGHTING:
SteamInput()->ActivateActionSet( STEAM_INPUT_HANDLE_ALL_CONTROLLERS, fightingSetHandle );
doFightingStuff();
break;
}
}
ActivateActionSetLayer
void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, для якого ви хочете активувати шар набору дій. |
actionSetHandle | InputActionSetHandle_t | Дескриптор шару набору дій, який ви хочете активувати. |
Змінює конфігурацію контролера для використання вказаного шару набору дій.
Дивіться документацію «
Шари наборів дій» для подробиць та прикладів використання.
Приклад:SteamInput()->ActivateActionSetLayer( inputHandle1, myActionSetLayer );
DeactivateActionSetLayer
void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, для якого ви хочете деактивувати шар набору дій. |
actionSetHandle | InputActionSetHandle_t | Дескриптор шару набору дій, який ви хочете деактивувати. |
Змінює конфігурацію контролера для припинення використання вказаного шару набору дій.
Приклад:SteamInput()->DeactivateActionSetLayer( inputHandle1, myActionSetLayer );
DeactivateAllActionSetLayers
void DeactivateAllActionSetLayers( InputHandle_t inputHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, для якого ви хочете деактивувати всі шари наборів дій. |
Змінює конфігурацію контролера для припинення використання всіх указаних шарів набору дій.
Приклад:SteamInput()->DeactivateAllActionSetLayers( inputHandle1 );
GetActiveActionSetLayers
int GetActiveActionSetLayers( InputHandle_t inputHandle, InputActionSetHandle_t *handlesOut );
Заповнює масив усіма поточними активними шарами набору дій для вказаного дескриптора контролера.
Приклад:InputHandle_t *handlesOut = new InputHandle_t [];
SteamInput()->GetActiveActionSetLayers( inputHandle1, &handlesOut );
GetActionSetHandle
InputActionSetHandle_t GetActionSetHandle( const char *pszActionSetName );
Назва | Тип | Опис |
pszActionSetName | const char * | Рядок-ідентифікатор набору дій, що визначений у VDF-файлі гри. |
Пошук дескриптора для набору дій. Рекомендується викликати його один раз під час запуску та зберігати дескриптори для всіх майбутніх викликів API.
Повертає: InputActionSetHandle_tДескриптор вказаного набору дій.
Приклад:InputActionSetHandle_t fightingSetHandle = SteamInput()->GetActionSetHandle( "fighting" );
GetAnalogActionData
InputAnalogActionData_t GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, до якого ви хочете подати запит. |
analogActionHandle | InputAnalogActionHandle_t | Дескриптор аналогової дії, до якої ви хочете подати запит. |
Повертає поточний стан наданої аналогової ігрової дії.
Повертає:InputAnalogActionData_tПоточний стан вказаної аналогової дії.
Приклад:InputAnalogActionData_t data = SteamInput()->GetAnalogActionData( controller1Handle, moveHandle );
GetAnalogActionHandle
InputAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName );
Назва | Тип | Опис |
pszActionName | const char * | Рядок-ідентифікатор аналогової дії, що визначена у VDF-файлі гри. |
Отримує дескриптор вказаної аналогової дії.
ПРИМІТКА: ця функція не приймає параметр дескриптора набору дій. Це значить, що кожна дія у VDF-файлі повинна мати унікальний рядок-ідентифікатор. Іншими словами, якщо ви використовуєте дію із назвою «up» у двох різних наборах дій, то функція поверне лише одну з них та проігнорує іншу.
Повертає:InputAnalogActionHandle_tДескриптор вказаної аналогової дії.
Приклад:InputAnalogActionHandle_t moveHandle = SteamInput()->GetAnalogActionHandle( "move" );
GetAnalogActionOrigins
int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin *originsOut );
Отримує джерела аналогової дії, що є частиною набору дій, шляхом заповнення масиву originsOut дескрипторами EInputActionOrigin. Показує відповідну екранну підказку для дії.
Повертає: int
Кількість джерел у масиві
originsOut
.
Приклад:EInputActionOrigin *origins = new EInputActionOrigin[];
SteamInput()->GetAnalogActionOrigins( controller1Handle, walkingSetHandle, moveHandle, origins );
GetConnectedControllers
int GetConnectedControllers( InputHandle_t *handlesOut );
Перераховує поточні підключені контролери шляхом заповнення масиву handlesOut дескрипторами контролерів.
Повертає: int
Кількість дескрипторів, записаних у масиві
handlesOut
.
Приклад:InputHandle_t *inputHandles = new InputHandle_t[];
SteamInput()->GetConnectedControllers( inputHandles );
GetControllerForGamepadIndex
InputHandle_t GetControllerForGamepadIndex( int nIndex );
Назва | Тип | Опис |
nIndex | int | Індекс емульованого ґеймпада, для якого ви хочете отримати дескриптор контролера. |
Повертає пов’язаний дескриптор контролера для вказаного емульованого ґеймпада. Можна використовувати з функцією GetInputTypeForHandle для визначення типу контролера за допомогою емуляції ґеймпада введенням Steam.
Повертає: InputHandle_tПриклад:// Replace with the XInput Slot you are querying for. Це число від 0 до 3
int nXinputSlotIndex = 0;
InputHandle_t inputHandle = SteamInput()->GetControllerForGamepadIndex( nXinputSlotIndex );
if ( inputHandle == 0 )
{
// Дійсні дескриптори введення не є 0, це звичайний контролер Xbox.
}
else
{
ESteamInputType inputType = SteamInput()->GetInputTypeForHandle( inputHandle );
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
InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, до якого ви хочете подати запит. |
Отримує поточний активний набір дій для вказаного контролера.
Повертає: InputActionSetHandle_tДескриптор набору дій, активованого для вказаного контролера.
Приклад:InputActionSetHandle_t controller1Set = SteamInput()->GetCurrentActionSet(controller1Handle);
GetDigitalActionData
InputDigitalActionData_t GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle );
Повертає поточний стан наданої цифрової ігрової дії.
Повертає:InputDigitalActionData_tПоточний стан вказаної цифрової дії.
GetDigitalActionHandle
InputDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName );
Назва | Тип | Опис |
pszActionName | const char * | Рядок-ідентифікатор цифрової дії, що визначена у VDF-файлі гри. |
Отримує дескриптор вказаної цифрової дії.
ПРИМІТКА: ця функція не приймає параметр дескриптора набору дій. Це значить, що кожна дія у VDF-файлі повинна мати унікальний рядок-ідентифікатор. Іншими словами, якщо ви використовуєте дію із назвою «up» у двох різних наборах дій, то функція поверне лише одну з них та проігнорує іншу.
Повертає:InputDigitalActionData_tДескриптор вказаної цифрової дії.
Приклад:InputDigitalActionHandle_t punchHandle = SteamInput()->GetDigitalActionHandle( "punch" );
GetDigitalActionOrigins
int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin *originsOut );
Отримує джерела цифрової дії, що є частиною набору дій, шляхом заповнення масиву
originsOut
дескрипторами
EInputActionOrigin. Показує відповідну екранну підказку для дії.
Повертає: int
Кількість джерел у масиві
originsOut
.
Приклад:EInputActionOrigin *origins = new EInputActionOrigin[];
SteamInput()->GetDigitalActionOrigins( controller1Handle, fightingSetHandle, punchHandle, origins );
GetGamepadIndexForController
int GetGamepadIndexForController( InputHandle_t ulControllerHandle );
Назва | Тип | Опис |
ulControllerHandle | InputHandle_t | Дескриптор контролера, для якого ви хочете отримати індекс ґеймпада. |
Повертає індекс пов’язаного ґеймпада для вказаного контролера, якщо ґеймпад емулюється.
Повертає: int
Приклад:int gamepadIndex = SteamInput()->GetGamepadIndexForController( controller1Handle );
GetGlyphForActionOrigin
const char * GetGlyphForActionOrigin( EInputActionOrigin eOrigin );
Отримує локальний шлях до зображення для екранного гліфу певного джерела.
Повертає: 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"
Приклад:// Gets origins for "punch"
EInputActionOrigin *origins = new EInputActionOrigin[];
SteamInput()->GetDigitalActionOrigins( controller1Handle, fightingSetHandle, punchHandle, origins );
EInputActionOrigin firstOrigin = origins[0]; //i.e, k_EInputActionOrigin_PS4_X
// This is a function from the game itself that tries to get custom glyph art
int glyphTextureID = getHardCodedButtonGlyphTexture( firstOrigin );
// We didn't ship any art in our game for this origin! Імовірно, Steam додав підтримку для
// нового контролера, або ми просто забули додати це зображення!
//(наприклад, потрібне зображення для контролера PlayStation 4, але наявне лише для контролера Steam)
if( glyphTextureID == -1 )
{
// Просто візьміть зображення з клієнта Steam.
const char *localGlyphPath = SteamInput()->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( InputHandle_t inputHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, щодо типу введення якого (моделі пристрою) ви хочете подати запит |
Повертає тип введення (модель пристрою) для вказаного контролера. Так ви зможете дізнатися модель певного контролера: чи це контролер Steam, контролер Xbox 360, контролер PS4 тощо.
Повертає: ESteamInputTypeПриклад:ESteamInputType inputType = SteamInput()->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
InputMotionData_t GetMotionData( InputHandle_t inputHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, для якого ви хочете отримати дані руху. |
Повертає необроблені дані руху для вказаного контролера.
Повертає: InputMotionData_tПриклад:InputMotionData_t motionData = SteamInput()->GetControllerMotionData( inputHandle );
GetStringForActionOrigin
const char * GetStringForActionOrigin( EInputActionOrigin eOrigin );
Повертає локалізований рядок (відповідно до мовних налаштувань Steam) для вказаного джерела.
Повертає: const char *
Приклад:EInputActionOrigin *origins = new EInputActionOrigin[];
SteamInput()->GetDigitalActionOrigins( controller1Handle, fightingSetHandle, punchHandle, origins );
const char * punchString = SteamInput()->GetStringForActionOrigin( origins[0] );
printf("punch = %s\n",punchString);
Init
bool Init();
Необхідно викликати у випадку початку використання інтерфейсу
ISteamInput.
Повертає: bool
Завжди повертає
true.
Приклад:SteamInput()->Init();
RunFrame
void RunFrame();
Синхронізує стан API з останніми доступними введеннями контролера Steam. Здійснюється автоматично за допомогою виклику SteamAPI_RunCallbacks, але для найменшої можливої затримки ви можете викликати його безпосередньо перед читанням стану контролера.
Приклад:SteamInput()->RunFrame();
SetDualSenseTriggerEffect
void SetDualSenseTriggerEffect( InputHandle_t inputHandle, const ScePadTriggerEffectParam *pParam );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, на який здійснюється вплив. |
pParam | ScePadTriggerEffectParam | The trigger parameter, defined in isteamdualsense.h |
Set the trigger effect for a DualSense controller.
Example:ScePadTriggerEffectParam param;
memset( ¶m, 0, sizeof( param ) );
param.triggerMask = SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2;
param.command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2].mode = SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION;
param.command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2].commandData.vibrationParam.position = 5;
param.command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2].commandData.vibrationParam.amplitude = 5;
param.command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2].commandData.vibrationParam.frequency = 8;
SteamInput()->SetDualSenseTriggerEffect( controller1Handle, ¶m );
SetLEDColor
void SetLEDColor( InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags );
Назва | Тип | Опис |
inputHandle | InputHandle_t | The handle of the controller to affect. |
nColorR | uint8 | The red component of the color to set (0-255). |
nColorG | uint8 | The green component of the color to set (0-255). |
nColorB | uint8 | The blue component of the color to set (0-255). |
nFlags | unsigned int | Bit-masked flags combined from values defined in ESteamControllerLEDFlag. |
Set the controller LED color on supported controllers.
Notes: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.
Example:// Restore the user default color for controller 1:
SteamInput()->SetLEDColor( controller1Handle, 0, 0, 0, k_ESteamControllerLEDFlag_RestoreUserDefault );
// Set the color to magenta for controller 2:
SteamInput()->SetLEDColor( controller2Handle, 255, 0, 255, k_ESteamControllerLEDFlag_SetColor );
ShowAnalogActionOrigins
bool ShowAnalogActionOrigins( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition );
Deprecated.
Returns: bool
Always returns
true.
ShowBindingPanel
bool ShowBindingPanel( InputHandle_t inputHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | The handle of the controller you want to bring up the binding screen for. |
Invokes the Steam overlay and brings up the binding screen.
Returns: bool
true for success;
false if overlay is disabled/unavailable. If the player is using Big Picture Mode the configuration will open in the overlay. In desktop mode a popup window version of Big Picture will be created and open the configuration.
Example:SteamInput()->ShowBindingPanel( myControllerHandle );
ShowDigitalActionOrigins
bool ShowDigitalActionOrigins( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle, float flScale, float flXPosition, float flYPosition );
Deprecated.
Повертає: bool
Завжди повертає
true.
Shutdown
bool Shutdown();
Must be called when ending use of the
ISteamInput interface.
Returns: bool
Always returns
true.
Example:SteamInput()->Shutdown();
StopAnalogActionMomentum
void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction );
Stops the momentum of an analog action (where applicable, i.e. a touchpad w/ virtual trackball settings).
NOTE: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.
Example:SteamInput()->StopAnalogActionMomentum( controller1Handle, moveHandle );
TriggerHapticPulse
void TriggerHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, на який здійснюється вплив. |
eTargetPad | ESteamControllerPad | Which haptic touchpad to affect. |
usDurationMicroSec | unsigned short | Duration of the pulse, in microseconds (1/1,000,000th of a second) |
Triggers a (low-level) haptic pulse on supported controllers.
Notes: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.
Example://Pulse once for 1/20th of a second
SteamInput()->TriggerHapticPulse(controller1Handle, k_ESteamControllerPad_Left, 50000);
TriggerRepeatedHapticPulse
void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags );
Назва | Тип | Опис |
inputHandle | InputHandle_t | Дескриптор контролера, на який здійснюється вплив. |
eTargetPad | ESteamControllerPad | Which haptic touchpad to affect. |
usDurationMicroSec | unsigned short | Duration of the pulse, in microseconds (1/1,000,000th of a second). |
usOffMicroSec | unsigned short | Duration of the pause between pulses, in microseconds. |
unRepeat | unsigned short | Number of times to repeat the usDurationMicroSec / usOffMicroSec duty cycle. |
nFlags | unsigned int | Currently unused and reserved for future use. |
Triggers a repeated haptic pulse on supported controllers.
Notes:Currently only the Steam Controller, Steam Deck, and Nintendo Switch Pro Controller devices support 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.
Example://Pulse for 1 second with an on/off pulse pattern of 1/20th of a second each
SteamInput()->TriggerRepeatedHapticPulse( controller1Handle, k_ESteamControllerPad_Left, 50000, 50000, 10 );
TriggerVibration
void TriggerVibration( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed );
Назва | Тип | Опис |
inputHandle | InputHandle_t | The handle of the controller to affect. |
usLeftSpeed | unsigned short | The intensity value for the left rumble motor. |
usRightSpeed | unsigned short | The intensity value of the right rumble motor. |
Trigger a vibration event on supported controllers.
Notes: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.
Example:SteamInput()->TriggerVibration( controller1Handle, 10000, 10000 );
TriggerVibrationExtended
void TriggerVibrationExtended( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed );
Назва | Тип | Опис |
inputHandle | InputHandle_t | The handle of the controller to affect. |
usLeftSpeed | unsigned short | The intensity value for the left rumble motor. |
usRightSpeed | unsigned short | The intensity value of the right rumble motor. |
usLeftTriggerSpeed | unsigned short | The intensity value for the left Xbox Impulse Trigger motor. |
usRightTriggerSpeed | unsigned short | The intensity value of the right Xbox Impulse Trigger motor. |
Trigger a vibration event on supported controllers, including Xbox Impulse Trigger motor values.
Notes:On Windows support for Xbox Impulse Trigger motor values requires user installation of the Xbox Extended Feature support driver.
The Steam Controller and Steam Deck will emulate traditional rumble using their haptics.
Example:SteamInput()->TriggerVibrationExtended( controller1Handle, 10000, 10000, 10000, 10000 );
GetActionOriginFromXboxOrigin
EInputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, EXboxOrigin eOrigin );
Назва | Тип | Опис |
inputHandle | InputHandle_t | The handle of the controller to affect. You can use GetControllerForGamepadIndex to get this handle |
eOrigin | EXboxOrigin | This is the button you want to get the image for ex: k_EXboxOrigin_A |
Returns: EInputActionOrigin
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
InputHandle_t controller1Handle = GetControllerForGamepadIndex( nXinputSlot );
EInputActionOrigin buttonOrigin = SteamInput()->GetActionOriginFromXboxOrigin( controller1Handle, k_EXboxOrigin_A );
// Gets the image from the Steam client .
const char *localGlyphPath = SteamInput()->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
EInputActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin );
Назва | Тип | Опис |
inputHandle | InputHandle_t | The handle of the controller to affect. You can use GetControllerForGamepadIndex to get this handle |
eDestinationInputType | ESteamInputType | The controller type you want to translate to. Steam will pick the closest type from your SDK version if k_ESteamInputType_Unknown is used |
eSourceOrigin | EInputActionOrigin | This is the button you want to translate |
Returns: EInputActionOrigin
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; // Substitutes whatever the correct Xinput slot is for your player
InputHandle_t controller1Handle = GetControllerForGamepadIndex( nXinputSlot );
EInputActionOrigin buttonOrigin = SteamInput()->GetActionOriginFromXboxOrigin( controller1Handle, k_EXboxOrigin_A ); //i.e, k_EInputActionOrigin_PS4_X
if ( buttonOrigin >= k_EInputActionOrigin_Count )
{
// We didn't ship any art in our game for this origin! I guess Steam has added support for
// a new controller. Let's get the closest value that was supported by the SDK we built against
buttonOrigin = SteamInput()->TranslateActionOrigin( k_ESteamInputType_Unknown, buttonOrigin )
}
// This is a function from the game itself that tries to get custom glyph art
int glyphTextureID = getHardCodedButtonGlyphTexture( actionOrigin );
GetDeviceBindingRevision
bool GetDeviceBindingRevision( InputHandle_t inputHandle, int *pMajor, int *pMinor );
Назва | Тип | Опис |
inputHandle | InputHandle_t | The handle of the controller to query. |
pMajor | int * | Pointer to int that Major binding revision will be populated into |
pMinor | int * | Pointer to int that Minor binding revision will be populated into |
Returns: bool - true if a device binding was successfully found and false if the binding is still loading.
Gets the major and minor device binding revisions for Steam Input API configurations. 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 disagrees 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. Minor revisions are for small changes such as adding a new optional action or updating localization in the configuration. When updating the minor revision you generally can update a single configuration and check the "Use Action Block" to apply the action block changes to the other configurations.
Example Code:int nMajorRevision = -1;
int nMinorRevision= -1;
const int nCurrentMajorRevision = 1;
const int nCurrentMinorRevision = 1;
if ( GetDeviceBindingRevision( inputHandle, &nMajorRevision , &nMinorRevision ) )
{
if ( nMinorRevision != nCurrentMinorRevision )
{
// The minor version out of date, but that's ok
// next time they edit their config this will get fixed
}
if ( nMajorRevision != nCurrentMajorRevision )
{
// This should only happen briefly while Steam detects
// and then force-updates the user to the latest official config
}
}
else
{
// The configuration isn't loaded for this controller yet
}
Example In-game Action File Usage:"In Game Actions"
{
"major_revision" "0"
"minor_revision" "1"
"actions"
{
...
GetRemotePlaySessionID
uint32 GetRemotePlaySessionID( InputHandle_t inputHandle );
Назва | Тип | Опис |
inputHandle | InputHandle_t | The handle of the controller to query. |
Returns: uint32 - Steam Remote Play session ID
Get the Steam Remote Play session ID associated with a device, or 0 if there is no session associated with it. See isteamremoteplay.h for more information on Steam Remote Play sessions.
Структури
These are structs which functions in ISteamInput may return and/or interact with.
InputAnalogActionData_t
Represents the current state of an analog action.
Notes: - Точні значення, діапазони тощо залежать від конфігурації, але (загалом) традиційні аналогові дії повинні надавати нормовані значення типу float в інтервалі від -1,0 до 1,0, а дії, що схожі на дії миші, повинні надавати зміни дельт, котрі показують кількість «пікселів» стосовно попереднього кадру. Таким чином, схожі на мишу дії надають x та y із великими абсолютними значеннями й відносно до останньої записаної позиції, тоді як традиційні аналогові дії мають менші значення й відносні до центрального якоря.
- Хоча дельти, які надаються схожими на мишу діями, дуже подібні до піксельних дельт від ОС, дельти контролерів є значеннями типу float, а не int. Відповідно, під час прив’язування цих даних до обертання камери менше втрачається точність й відбувається менша дискретизація.
- У випадку одновісних елементів введення (наприклад, аналогових триґерів) дані міститимуться лише на вісі x, а значення вісі y завжди дорівнюватиме нулю.
Назва | Тип | Опис |
eMode | EControllerSourceMode | The type of data coming from this action, this will match what was specified in the action set's VDF definition. |
x | float | The current state of this action on the horizontal axis. |
y | float | The current state of this action vertical axis. |
bActive | bool | Whether or not this action is currently available to be bound in the active action set. If it is not available, OR does not belong to the active action set, this will be false. |
InputDigitalActionData_t
Represents the current state of a digital action.
Назва | Type | Опис |
bState | bool | The current state of this action; true if the action is currently pressed, otherwise false. |
bActive | bool | Whether or not this action is currently available to be bound in the active action set. |
InputMotionData_t
Represents the current state of a device's motion sensor(s).
NOTE: For rotQuatX/rotQuatY/rotQuatZ/rotQuatW, the inertial measurement unit on the controller will create a quaternion based on fusing the gyro and the accelerometer. This value is the absolute orientation of the controller, but it will drift on the yaw axis.
Positional acceleration is reported as an interpolated value between INT16_MIN and INT16_MAX where the extents are clamped to ±2G (1G = 9.80665 m/s
2).
Angular velocity is reported as an interpolated value between INT16_MIN and INT16_MAX where the extents are clamped to ±2000 degrees per second.
Назва | Type | Опис |
rotQuatX | float | Sensor-fused absolute rotation (will drift in heading), x axis |
rotQuatY | float | Sensor-fused absolute rotation (will drift in heading), y axis |
rotQuatZ | float | Sensor-fused absolute rotation (will drift in heading), z axis |
rotQuatW | float | Sensor-fused absolute rotation (will drift in heading), w axis |
posAccelX | float | Positional acceleration, x axis |
posAccelY | float | Positional acceleration, y axis |
posAccelZ | float | Positional acceleration, z axis |
rotVelX | float | Angular velocity, x axis |
rotVelY | float | Angular velocity, y axis |
rotVelZ | float | Angular velocity, z axis |
Перерахування
These are enums which are defined for use with ISteamInput.
EInputActionOrigin
Inputs the player binds to actions in the Steam Input Configurator. The chief purpose of these values is to direct which on-screen button glyphs should appear for a given action, such as "Press [A] to Jump".
Назва | Значення | Опис |
k_EInputActionOrigin_None | 0 | |
k_EInputActionOrigin_A | 1 | (Valve Steam Controller) digital face button A |
k_EInputActionOrigin_B | 2 | (Valve Steam Controller) digital face button B |
k_EInputActionOrigin_X | 3 | (Valve Steam Controller) digital face button X |
k_EInputActionOrigin_Y | 4 | (Valve Steam Controller) digital face button Y |
k_EInputActionOrigin_LeftBumper | 5 | (Valve Steam Controller) digital left shoulder button (aka left bumper) |
k_EInputActionOrigin_RightBumper | 6 | (Valve Steam Controller) digital right shoulder button (aka right bumper) |
k_EInputActionOrigin_LeftGrip | 7 | (Valve Steam Controller) digital left grip paddle |
k_EInputActionOrigin_RightGrip | 8 | (Valve Steam Controller) digital right grip paddle |
k_EInputActionOrigin_Start | 9 | (Valve Steam Controller) digital start button |
k_EInputActionOrigin_Back | 10 | (Valve Steam Controller) digital back button |
k_EInputActionOrigin_LeftPad_Touch | 11 | (Valve Steam Controller) left haptic touchpad, in simple contact with a finger |
k_EInputActionOrigin_LeftPad_Swipe | 12 | (Valve Steam Controller) left haptic touchpad, touch input on any axis |
k_EInputActionOrigin_LeftPad_Click | 13 | (Valve Steam Controller) left haptic touchpad, digital click (for the whole thing) |
k_EInputActionOrigin_LeftPad_DPadNorth | 14 | (Valve Steam Controller) left haptic touchpad, digital click (upper quadrant) |
k_EInputActionOrigin_LeftPad_DPadSouth | 15 | (Valve Steam Controller) left haptic touchpad, digital click (lower quadrant) |
k_EInputActionOrigin_LeftPad_DPadWest | 16 | (Valve Steam Controller) left haptic touchpad, digital click (left quadrant) |
k_EInputActionOrigin_LeftPad_DPadEast | 17 | (Valve Steam Controller) left haptic touchpad, digital click (right quadrant) |
k_EInputActionOrigin_RightPad_Touch | 18 | (Valve Steam Controller) right haptic touchpad, in simple contact with a finger |
k_EInputActionOrigin_RightPad_Swipe | 19 | (Valve Steam Controller) right haptic touchpad, touch input on any axis |
k_EInputActionOrigin_RightPad_Click | 20 | (Valve Steam Controller) right haptic touchpad, digital click (for the whole thing) |
k_EInputActionOrigin_RightPad_DPadNorth | 21 | (Valve Steam Controller) right haptic touchpad, digital click (upper quadrant) |
k_EInputActionOrigin_RightPad_DPadSouth | 22 | (Valve Steam Controller) right haptic touchpad, digital click (lower quadrant) |
k_EInputActionOrigin_RightPad_DPadWest | 23 | (Valve Steam Controller) right haptic touchpad, digital click (left quadrant) |
k_EInputActionOrigin_RightPad_DPadEast | 24 | (Valve Steam Controller) right haptic touchpad, digital click (right quadrant) |
k_EInputActionOrigin_LeftTrigger_Pull | 25 | (Valve Steam Controller) left analog trigger, pulled by any amount (analog value) |
k_EInputActionOrigin_LeftTrigger_Click | 26 | (Valve Steam Controller) left analog trigger, pulled in all the way (digital value) |
k_EInputActionOrigin_RightTrigger_Pull | 27 | (Valve Steam Controller) right analog trigger, pulled by any amount (analog value) |
k_EInputActionOrigin_RightTrigger_Click | 28 | (Valve Steam Controller) right analog trigger, pulled in all the way (digital value) |
k_EInputActionOrigin_LeftStick_Move | 29 | (Valve Steam Controller) left joystick, movement on any axis (analog value) |
k_EInputActionOrigin_LeftStick_Click | 30 | (Valve Steam Controller) left joystick, clicked in (digital value) |
k_EInputActionOrigin_LeftStick_DPadNorth | 31 | (Valve Steam Controller) left joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_LeftStick_DPadSouth | 32 | (Valve Steam Controller) left joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_LeftStick_DPadWest | 33 | (Valve Steam Controller) left joystick, digital movement (left quadrant) |
k_EInputActionOrigin_LeftStick_DPadEast | 34 | (Valve Steam Controller) left joystick, digital movement (right quadrant) |
k_EInputActionOrigin_Gyro_Move | 35 | (Valve Steam Controller) gyroscope, analog movement in any axis |
k_EInputActionOrigin_Gyro_Pitch | 36 | (Valve Steam Controller) gyroscope, analog movement on the Pitch axis (point head up to ceiling, point head down to floor) |
k_EInputActionOrigin_Gyro_Yaw | 37 | (Valve Steam Controller) gyroscope, analog movement on the Yaw axis (turn head left to face one wall, turn head right to face other) |
k_EInputActionOrigin_Gyro_Roll | 38 | (Valve Steam Controller) gyroscope, analog movement on the Roll axis (tilt head left towards shoulder, tilt head right towards other) |
k_EInputActionOrigin_SteamController_Reserved0 | 39 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved1 | 40 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved2 | 41 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved3 | 42 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved4 | 43 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved5 | 44 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved6 | 45 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved7 | 46 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved8 | 47 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved9 | 48 | Reserved for future use |
k_EInputActionOrigin_SteamController_Reserved10 | 49 | Reserved for future use |
k_EInputActionOrigin_PS4_X | 50 | (Sony Dualshock 4) digital face button X |
k_EInputActionOrigin_PS4_Circle | 51 | (Sony Dualshock 4) digital face button Circle |
k_EInputActionOrigin_PS4_Triangle | 52 | (Sony Dualshock 4) digital face button Triangle |
k_EInputActionOrigin_PS4_Square | 53 | (Sony Dualshock 4) digital face button Square |
k_EInputActionOrigin_PS4_LeftBumper | 54 | (Sony Dualshock 4) digital left shoulder button (aka left bumper) |
k_EInputActionOrigin_PS4_RightBumper | 55 | (Sony Dualshock 4) digital right shoulder button (aka right bumper) |
k_EInputActionOrigin_PS4_Options | 56 | (Sony Dualshock 4) digital options button (aka Start) |
k_EInputActionOrigin_PS4_Share | 57 | (Sony Dualshock 4) digital share button (aka Back) |
k_EInputActionOrigin_PS4_LeftPad_Touch | 58 | (Sony Dualshock 4) left half of the touchpad, in simple contact with a finger |
k_EInputActionOrigin_PS4_LeftPad_Swipe | 59 | (Sony Dualshock 4) left half of the touchpad, touch input on any axis |
k_EInputActionOrigin_PS4_LeftPad_Click | 60 | (Sony Dualshock 4) left half of the touchpad, digital click (for the whole thing) |
k_EInputActionOrigin_PS4_LeftPad_DPadNorth | 61 | (Sony Dualshock 4) left half of the touchpad, digital click (upper quadrant) |
k_EInputActionOrigin_PS4_LeftPad_DPadSouth | 62 | (Sony Dualshock 4) left half of the touchpad, digital click (lower quadrant) |
k_EInputActionOrigin_PS4_LeftPad_DPadWest | 63 | (Sony Dualshock 4) left half of the touchpad, digital click (left quadrant) |
k_EInputActionOrigin_PS4_LeftPad_DPadEast | 64 | (Sony Dualshock 4) left half of the touchpad, digital click (right quadrant) |
k_EInputActionOrigin_PS4_RightPad_Touch | 65 | (Sony Dualshock 4) right half of the touchpad, in simple contact with a finger |
k_EInputActionOrigin_PS4_RightPad_Swipe | 66 | (Sony Dualshock 4) right half of the touchpad, touch input on any axis |
k_EInputActionOrigin_PS4_RightPad_Click | 67 | (Sony Dualshock 4) right half of the touchpad, digital click (for the whole thing) |
k_EInputActionOrigin_PS4_RightPad_DPadNorth | 68 | (Sony Dualshock 4) right half of the touchpad, digital click (upper quadrant) |
k_EInputActionOrigin_PS4_RightPad_DPadSouth | 69 | (Sony Dualshock 4) right half of the touchpad, digital click (lower quadrant) |
k_EInputActionOrigin_PS4_RightPad_DPadWest | 70 | (Sony Dualshock 4) right half of the touchpad, digital click (left quadrant) |
k_EInputActionOrigin_PS4_RightPad_DPadEast | 71 | (Sony Dualshock 4) right half of the touchpad, digital click (right quadrant) |
k_EInputActionOrigin_PS4_CenterPad_Touch | 72 | (Sony Dualshock 4) unified touchpad, in simple contact with a finger |
k_EInputActionOrigin_PS4_CenterPad_Swipe | 73 | (Sony Dualshock 4) unified touchpad, touch input on any axis |
k_EInputActionOrigin_PS4_CenterPad_Click | 74 | (Sony Dualshock 4) unified touchpad, digital click (for the whole thing) |
k_EInputActionOrigin_PS4_CenterPad_DPadNorth | 75 | (Sony Dualshock 4) unified touchpad, digital click (upper quadrant) |
k_EInputActionOrigin_PS4_CenterPad_DPadSouth | 76 | (Sony Dualshock 4) unified touchpad, digital click (lower quadrant) |
k_EInputActionOrigin_PS4_CenterPad_DPadWest | 77 | (Sony Dualshock 4) unified touchpad, digital click (left quadrant) |
k_EInputActionOrigin_PS4_CenterPad_DPadEast | 78 | (Sony Dualshock 4) unified touchpad, digital click (right quadrant) |
k_EInputActionOrigin_PS4_LeftTrigger_Pull | 79 | (Sony Dualshock 4) left analog trigger, pulled by any amount (analog value) |
k_EInputActionOrigin_PS4_LeftTrigger_Click | 80 | (Sony Dualshock 4) left analog trigger, pulled in all the way (digital value) |
k_EInputActionOrigin_PS4_RightTrigger_Pull | 81 | (Sony Dualshock 4) right analog trigger, pulled by any amount (analog value) |
k_EInputActionOrigin_PS4_RightTrigger_Click | 82 | (Sony Dualshock 4) right analog trigger, pulled in all the way (digital value) |
k_EInputActionOrigin_PS4_LeftStick_Move | 83 | (Sony Dualshock 4) left joystick, movement on any axis (analog value) |
k_EInputActionOrigin_PS4_LeftStick_Click | 84 | (Sony Dualshock 4) left joystick, clicked in (digital value) |
k_EInputActionOrigin_PS4_LeftStick_DPadNorth | 85 | (Sony Dualshock 4) left joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_PS4_LeftStick_DPadSouth | 86 | (Sony Dualshock 4) left joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_PS4_LeftStick_DPadWest | 87 | (Sony Dualshock 4) left joystick, digital movement (left quadrant) |
k_EInputActionOrigin_PS4_LeftStick_DPadEast | 88 | (Sony Dualshock 4) left joystick, digital movement (right quadrant) |
k_EInputActionOrigin_PS4_RightStick_Move | 89 | (Sony Dualshock 4) right joystick, movement on any axis (analog value) |
k_EInputActionOrigin_PS4_RightStick_Click | 90 | (Sony Dualshock 4) right joystick, clicked in (digital value) |
k_EInputActionOrigin_PS4_RightStick_DPadNorth | 91 | (Sony Dualshock 4) right joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_PS4_RightStick_DPadSouth | 92 | (Sony Dualshock 4) right joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_PS4_RightStick_DPadWest | 93 | (Sony Dualshock 4) right joystick, digital movement (left quadrant) |
k_EInputActionOrigin_PS4_RightStick_DPadEast | 94 | (Sony Dualshock 4) right joystick, digital movement (right quadrant) |
k_EInputActionOrigin_PS4_DPad_North | 95 | (Sony Dualshock 4) digital pad, pressed (upper quadrant) |
k_EInputActionOrigin_PS4_DPad_South | 96 | (Sony Dualshock 4) digital pad, pressed (lower quadrant) |
k_EInputActionOrigin_PS4_DPad_West | 97 | (Sony Dualshock 4) digital pad, pressed (left quadrant) |
k_EInputActionOrigin_PS4_DPad_East | 98 | (Sony Dualshock 4) digital pad, pressed (right quadrant) |
k_EInputActionOrigin_PS4_Gyro_Move | 99 | (Sony Dualshock 4) gyroscope, analog movement in any axis |
k_EInputActionOrigin_PS4_Gyro_Pitch | 100 | (Sony Dualshock 4) gyroscope, analog movement on the Pitch axis (point head up to ceiling, point head down to floor) |
k_EInputActionOrigin_PS4_Gyro_Yaw | 101 | (Sony Dualshock 4) gyroscope, analog movement on the Yaw axis (turn head left to face one wall, turn head right to face other) |
k_EInputActionOrigin_PS4_Gyro_Roll | 102 | (Sony Dualshock 4) gyroscope, analog movement on the Roll axis (tilt head left towards shoulder, tilt head right towards other shoulder) |
k_EInputActionOrigin_PS4_Reserved0 | 103 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved1 | 104 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved2 | 105 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved3 | 106 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved4 | 107 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved5 | 108 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved6 | 109 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved7 | 110 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved8 | 111 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved9 | 112 | Reserved for future use |
k_EInputActionOrigin_PS4_Reserved10 | 113 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_A | 114 | (XB1) digital face button A |
k_EInputActionOrigin_XBoxOne_B | 115 | (XB1) digital face button B |
k_EInputActionOrigin_XBoxOne_X | 116 | (XB1) digital face button Cross |
k_EInputActionOrigin_XBoxOne_Y | 117 | (XB1) digital face button Y |
k_EInputActionOrigin_XBoxOne_LeftBumper | 118 | (XB1) digital left shoulder button (aka left bumper) |
k_EInputActionOrigin_XBoxOne_RightBumper | 119 | (XB1) digital right shoulder button (aka right bumper) |
k_EInputActionOrigin_XBoxOne_View | 121 | (XB1) digital view button (aka back) |
k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull | 122 | (XB1) left analog trigger, pulled by any amount (analog value) |
k_EInputActionOrigin_XBoxOne_LeftTrigger_Click | 123 | (XB1) left analog trigger, pulled in all the way (digital value) |
k_EInputActionOrigin_XBoxOne_RightTrigger_Pull | 124 | (XB1) right analog trigger, pulled by any amount (analog value) |
k_EInputActionOrigin_XBoxOne_RightTrigger_Click | 125 | (XB1) right analog trigger, pulled in all the way (digital value) |
k_EInputActionOrigin_XBoxOne_LeftStick_Move | 126 | (XB1) left joystick, movement on any axis (analog value) |
k_EInputActionOrigin_XBoxOne_LeftStick_Click | 127 | (XB1) left joystick, clicked in (digital value) |
k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth | 128 | (XB1) left joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth | 129 | (XB1) left joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest | 130 | (XB1) left joystick, digital movement (left quadrant) |
k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast | 131 | (XB1) left joystick, digital movement (right quadrant) |
k_EInputActionOrigin_XBoxOne_RightStick_Move | 132 | (XB1) right joystick, movement on any axis (analog value) |
k_EInputActionOrigin_XBoxOne_RightStick_Click | 133 | (XB1) right joystick, clicked in (digital value) |
k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth | 134 | (XB1) right joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth | 135 | (XB1) right joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_XBoxOne_RightStick_DPadWest | 136 | (XB1) right joystick, digital movement (left quadrant) |
k_EInputActionOrigin_XBoxOne_RightStick_DPadEast | 137 | (XB1) right joystick, digital movement (right quadrant) |
k_EInputActionOrigin_XBoxOne_DPad_North | 138 | (XB1) digital pad, pressed (upper quadrant) |
k_EInputActionOrigin_XBoxOne_DPad_South | 139 | (XB1) digital pad, pressed (lower quadrant) |
k_EInputActionOrigin_XBoxOne_DPad_West | 140 | (XB1) digital pad, pressed (left quadrant) |
k_EInputActionOrigin_XBoxOne_DPad_East | 141 | (XB1) digital pad, pressed (right quadrant) |
k_EInputActionOrigin_XBoxOne_Reserved0 | 142 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved1 | 143 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved2 | 144 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved3 | 145 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved4 | 146 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved5 | 147 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved6 | 148 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved7 | 149 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved8 | 150 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved9 | 151 | Reserved for future use |
k_EInputActionOrigin_XBoxOne_Reserved10 | 152 | Reserved for future use |
k_EInputActionOrigin_XBox360_A | 153 | (X360) digital face button A |
k_EInputActionOrigin_XBox360_B | 154 | (X360) digital face button B |
k_EInputActionOrigin_XBox360_X | 155 | (X360) digital face button X |
k_EInputActionOrigin_XBox360_Y | 156 | (X360) digital face button Y |
k_EInputActionOrigin_XBox360_LeftBumper | 157 | (X360) digital left shoulder button (aka left bumper) |
k_EInputActionOrigin_XBox360_RightBumper | 158 | (X360) digital right shoulder button (aka right bumper) |
k_EInputActionOrigin_XBox360_Start | 159 | (X360) digital start button |
k_EInputActionOrigin_XBox360_Back | 160 | (X360) digital back button |
k_EInputActionOrigin_XBox360_LeftTrigger_Pull | 161 | (X360) left analog trigger, pulled by any amount (analog value) |
k_EInputActionOrigin_XBox360_LeftTrigger_Click | 162 | (X360) left analog trigger, pulled in all the way (digital value) |
k_EInputActionOrigin_XBox360_RightTrigger_Pull | 163 | (X360) right analog trigger, pulled by any amount (analog value) |
k_EInputActionOrigin_XBox360_RightTrigger_Click | 164 | (X360) right analog trigger, pulled in all the way (digital value) |
k_EInputActionOrigin_XBox360_LeftStick_Move | 165 | (X360) left joystick, movement on any axis (analog value) |
k_EInputActionOrigin_XBox360_LeftStick_Click | 166 | (X360) left joystick, clicked in (digital value) |
k_EInputActionOrigin_XBox360_LeftStick_DPadNorth | 167 | (X360) left joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_XBox360_LeftStick_DPadSouth | 168 | (X360) left joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_XBox360_LeftStick_DPadWest | 169 | (X360) left joystick, digital movement (left quadrant) |
k_EInputActionOrigin_XBox360_LeftStick_DPadEast | 170 | (X360) left joystick, digital movement (right quadrant) |
k_EInputActionOrigin_XBox360_RightStick_Move | 171 | (X360) right joystick, movement on any axis (analog value) |
k_EInputActionOrigin_XBox360_RightStick_Click | 172 | (X360) right joystick, clicked in (digital value) |
k_EInputActionOrigin_XBox360_RightStick_DPadNorth | 173 | (X360) right joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_XBox360_RightStick_DPadSouth | 174 | (X360) right joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_XBox360_RightStick_DPadWest | 175 | (X360) right joystick, digital movement (left quadrant) |
k_EInputActionOrigin_XBox360_RightStick_DPadEast | 176 | (X360) right joystick, digital movement (right quadrant) |
k_EInputActionOrigin_XBox360_DPad_North | 177 | (X360) digital pad, pressed (upper quadrant) |
k_EInputActionOrigin_XBox360_DPad_South | 178 | (X360) digital pad, pressed (lower quadrant) |
k_EInputActionOrigin_XBox360_DPad_West | 179 | (X360) digital pad, pressed (left quadrant) |
k_EInputActionOrigin_XBox360_DPad_East | 180 | (X360) digital pad, pressed (right quadrant) |
k_EInputActionOrigin_XBox360_Reserved0 | 181 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved1 | 182 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved2 | 183 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved3 | 184 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved4 | 185 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved5 | 186 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved6 | 187 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved7 | 188 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved8 | 189 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved9 | 190 | Reserved for future use |
k_EInputActionOrigin_XBox360_Reserved10 | 191 | Reserved for future use |
k_EInputActionOrigin_Switch_A | 192 | (Nintendo Switch Pro) digital face button A |
k_EInputActionOrigin_Switch_B | 193 | (Nintendo Switch Pro) digital face button B |
k_EInputActionOrigin_Switch_X | 194 | (Nintendo Switch Pro) digital face button X |
k_EInputActionOrigin_Switch_Y | 195 | (Nintendo Switch Pro) digital face button Y |
k_EInputActionOrigin_Switch_LeftBumper | 196 | (Nintendo Switch Pro) digital left shoulder button (aka left bumper) |
k_EInputActionOrigin_Switch_RightBumper | 197 | (Nintendo Switch Pro) digital right shoulder button (aka right bumper) |
k_EInputActionOrigin_Switch_Plus | 198 | (Nintendo Switch Pro) plus button |
k_EInputActionOrigin_Switch_Minus | 199 | (Nintendo Switch Pro) minus button |
k_EInputActionOrigin_Switch_Capture | 200 | (Nintendo Switch Pro) digital capture button |
k_EInputActionOrigin_Switch_LeftTrigger_Pull | 201 | (Nintendo Switch Pro) left trigger, clicked |
k_EInputActionOrigin_Switch_LeftTrigger_Click | 202 | (Nintendo Switch Pro) left trigger, clicked (same as previous value) |
k_EInputActionOrigin_Switch_RightTrigger_Pull | 203 | (Nintendo Switch Pro) right trigger, clicked |
k_EInputActionOrigin_Switch_RightTrigger_Click | 204 | (Nintendo Switch Pro) right trigger, clicked (same as previous value) |
k_EInputActionOrigin_Switch_LeftStick_Move | 205 | (Nintendo Switch Pro) left joystick, movement on any axis (analog value) |
k_EInputActionOrigin_Switch_LeftStick_Click | 206 | (Nintendo Switch Pro) left joystick, clicked in (digital value) |
k_EInputActionOrigin_Switch_LeftStick_DPadNorth | 207 | (Nintendo Switch Pro) left joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_Switch_LeftStick_DPadSouth | 208 | (Nintendo Switch Pro) left joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_Switch_LeftStick_DPadWest | 209 | (Nintendo Switch Pro) left joystick, digital movement (left quadrant) |
k_EInputActionOrigin_Switch_LeftStick_DPadEast | 210 | (Nintendo Switch Pro) left joystick, digital movement (right quadrant) |
k_EInputActionOrigin_Switch_RightStick_Move | 211 | (Nintendo Switch Pro) right joystick, movement on any axis (analog value) |
k_EInputActionOrigin_Switch_RightStick_Click | 212 | (Nintendo Switch Pro) right joystick, clicked in (digital value) |
k_EInputActionOrigin_Switch_RightStick_DPadNorth | 213 | (Nintendo Switch Pro) right joystick, digital movement (upper quadrant) |
k_EInputActionOrigin_Switch_RightStick_DPadSouth | 214 | (Nintendo Switch Pro) right joystick, digital movement (lower quadrant) |
k_EInputActionOrigin_Switch_RightStick_DPadWest | 215 | (Nintendo Switch Pro) right joystick, digital movement (left quadrant) |
k_EInputActionOrigin_Switch_RightStick_DPadEast | 216 | (Nintendo Switch Pro) right joystick, digital movement (right quadrant) |
k_EInputActionOrigin_Switch_DPad_North | 217 | (Nintendo Switch Pro) digital pad, pressed (upper quadrant) |
k_EInputActionOrigin_Switch_DPad_South | 218 | (Nintendo Switch Pro) digital pad, pressed (lower quadrant) |
k_EInputActionOrigin_Switch_DPad_West | 219 | (Nintendo Switch Pro) digital pad, pressed (left quadrant) |
k_EInputActionOrigin_Switch_DPad_East | 220 | (Nintendo Switch Pro) digital pad, pressed (right quadrant) |
k_EInputActionOrigin_SwitchProGyro_Move | 221 | (Nintendo Switch Pro) gyroscope, analog movement in any axis |
k_EInputActionOrigin_SwitchProGyro_Pitch | 222 | (Nintendo Switch Pro) gyroscope, analog movement on the Pitch axis (point head up to ceiling, point head down to floor) |
k_EInputActionOrigin_SwitchProGyro_Yaw | 223 | (Nintendo Switch Pro) gyroscope, analog movement on the Yaw axis (turn head left to face one wall, turn head right to face other) |
k_EInputActionOrigin_SwitchProGyro_Roll | 224 | (Nintendo Switch Pro) gyroscope, analog movement on the Roll axis (tilt head left towards shoulder, tilt head right towards other shoulder) |
k_EInputActionOrigin_Switch_Reserved0 | 225 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved1 | 226 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved2 | 227 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved3 | 228 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved4 | 229 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved5 | 230 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved6 | 231 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved7 | 232 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved8 | 233 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved9 | 234 | Reserved for future use |
k_EInputActionOrigin_Switch_Reserved10 | 235 | Reserved for future use |
k_EInputActionOrigin_Count | 258 | The number of values in this enum, useful for iterating. |
k_EInputActionOrigin_MaximumPossibleValue | 32767 | The number of values in this enum, useful for iterating. |
EControllerSource
A region of the controller that can be thought of as a larger abstract modular unit that one of many modes can be applied to and output meaningful data. For example, a joystick can be treated as either a single analog input, or broken up into four discrete digital forming a virtual DPAD. Likewise, the ABXY face buttons form a natural group that be treated as four independent buttons, or as components of a virtual DPAD, etc.
Назва | Значення | Опис |
k_EInputSource_None | 0 | No controller source. |
k_EInputSource_LeftTrackpad | 1 | The left touchpad, or the left half of a central touchpad. |
k_EInputSource_RightTrackpad | 2 | The right touchpad, or the right half of a central touchpad. |
k_EInputSource_Joystick | 3 | The joystick, or if there is more than one joystick, the left joystick. |
k_EInputSource_ABXY | 4 | The four main face buttons. |
k_EInputSource_Switch | 5 | Switches/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_EInputSource_LeftTrigger | 6 | The left analog trigger. |
k_EInputSource_RightTrigger | 7 | The right analog trigger. |
k_EInputSource_Gyro | 8 | The internal gyroscope. |
k_EInputSource_CenterTrackpad | 9 | The central touchpad. (DS4 only) |
k_EInputSource_RightJoystick | 10 | The right joystick. If there is only one joystick, this source is not used. |
k_EInputSource_DPad | 11 | The digital pad. |
k_EInputSource_Key | 12 | Keyboard key (for keyboards with scan codes). |
k_EInputSource_Mouse | 13 | Traditional mouse |
k_EInputSource_Count | 14 | The 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_EInputSource_Joystick and the EControllerSourceMode would be k_EInputSourceMode_Dpad. The mode also changes the input data received by any associated actions.
Назва | Значення | Опис |
k_EInputSourceMode_None | 0 | No input mode. |
k_EInputSourceMode_Dpad | 1 | A 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_EInputSourceMode_Buttons | 2 | |
k_EInputSourceMode_FourButtons | 3 | Four digital face buttons, any of which can be pressed simultaneously |
k_EInputSourceMode_AbsoluteMouse | 4 | |
k_EInputSourceMode_RelativeMouse | 5 | |
k_EInputSourceMode_JoystickMove | 6 | |
k_EInputSourceMode_JoystickMouse | 7 | |
k_EInputSourceMode_JoystickCamera | 8 | |
k_EInputSourceMode_ScrollWheel | 9 | |
k_EInputSourceMode_Trigger | 10 | |
k_EInputSourceMode_MouseJoystick | 12 | |
k_EInputSourceMode_MouseRegion | 13 | |
k_EInputSourceMode_SingleButton | 15 | |
k_EInputSourceMode_Switches | 16 | |
ESteamControllerLEDFlag
Controls the color of a Steam Controller Device's LED (if the device indeed has one).
Notes:The VSC has an LED, but only its brightness will be affected (the color is always white).
The DS4's LED is the lightbar, whose color and brightness can both be configured.
Назва | Значення | Опис |
k_ESteamControllerLEDFlag_SetColor | 0 | Set the color to the specified values |
k_ESteamControllerLEDFlag_RestoreUserDefault | 1 | Restore the color to default (out-of-game) settings |
ESteamInputType
Represents the device model for a given piece of hardware.
Назва | Value | Опис |
k_ESteamInputType_Unknown | 0 | Catch-all for unrecognized devices |
k_ESteamInputType_SteamController | 1 | Valve's Steam Controller |
k_ESteamInputType_XBox360Controller | 2 | Microsoft's XBox 360 Controller |
k_ESteamInputType_XBoxOneController | 3 | Microsoft's XBox One Controller |
k_ESteamInputType_GenericXInput | 4 | Any generic 3rd-party XInput device |
k_ESteamInputType_PS4Controller | 5 | Sony's PlayStation 4 Controller |
k_ESteamInputType_AppleMFiController | 6 | Unused |
k_ESteamInputType_AndroidController | 7 | Unused |
k_ESteamInputType_SwitchJoyConPair | 8 | Unused |
k_ESteamInputType_SwitchJoyConSingle | 9 | Unused |
k_ESteamInputType_SwitchProController | 10 | Nintendo's Switch Pro Controller |
k_ESteamInputType_MobileTouch | 11 | Steam Link App's Mobile Touch Controller |
k_ESteamInputType_PS3Controller | 12 | Sony's PlayStation 3 Controller or PS3/PS4 compatible fight stick |
k_ESteamInputType_Count | 13 | Current number of values returned |
k_ESteamInputType_MaximumPossibleValue | 255 | Maximum possible value returned |
ESteamControllerPad
A touchpad region on a Steam Controller Device.
Notes:On the VSC, the values correspond to the left & right haptic touchpads.
On the DS4, the values correspond to the left & right halves of the single, central touchpad.
Назва | Value | Description |
k_ESteamControllerPad_Left | 0 | The left touchpad region on a Steam Controller Device. Compatible models: VSC, DS4 |
k_ESteamControllerPad_Right | 1 | The right region on a Steam Controller Device. Compatible models: VSC, DS4 |
Визначення типів
These are typedefs which are defined for use with ISteamInput.
Name | Base type | Description |
InputActionSetHandle_t | uint64 | These handles are used to refer to a specific in-game action or action set All action handles should be queried during initialization for performance reasons |
InputAnalogActionHandle_t | uint64 | A handle to an analog action. This can be obtained from ISteamInput::GetAnalogActionHandle. |
InputDigitalActionHandle_t | uint64 | A handle to a digital action. This can be obtained from ISteamInput::GetDigitalActionHandle. |
InputHandle_t | uint64 | This handle will consistently identify a controller, even if it is disconnected and re-connected |
Константи
These are constants which are defined for use with ISteamInput.
Name | Type | Value | Description |
STEAMINPUT_INTERFACE_VERSION | const char * | "SteamInput001" | |
STEAM_INPUT_HANDLE_ALL_CONTROLLERS | int | UINT64_MAX | When sending an option to a specific controller handle, you can use this special value in the place of a handle to send the option to all controllers instead. |
STEAM_INPUT_MAX_ANALOG_ACTIONS | int | 16 | The maximum number of analog actions that can be performed on each controller. |
STEAM_INPUT_MAX_ANALOG_ACTION_DATA | float | 1.0f | The maximum value that can be reported by an analog action on any given axis. |
STEAM_INPUT_MAX_COUNT | int | 16 | The maximum number of controllers that can be used simultaneously with the Steam Input Configurator. |
STEAM_INPUT_MAX_DIGITAL_ACTIONS | int | 128 | The maximum number of digital actions that can be performed on each controller. |
STEAM_INPUT_MAX_ORIGINS | int | 8 | The maximum number of input origins that can be attached to a single action. |
STEAM_INPUT_MIN_ANALOG_ACTION_DATA | float | -1.0f | The minimum value that can be reported by an analog action on any given axis. |