C# 클래스 Steamworks.SteamController

파일 보기 프로젝트 열기: rlabrecque/Steamworks.NET 1 사용 예제들

공개 메소드들

메소드 설명
ActivateActionSet ( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ) : void

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.

GetActionSetHandle ( string pszActionSetName ) : ControllerActionSetHandle_t

ACTION SETS

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

GetAnalogActionData ( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ) : ControllerAnalogActionData_t

Returns the current state of these supplied analog game action

GetAnalogActionHandle ( string pszActionName ) : ControllerAnalogActionHandle_t

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

GetAnalogActionOrigins ( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin originsOut ) : int

Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.

originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles

GetConnectedControllers ( ControllerHandle_t handlesOut ) : int

Enumerate currently connected controllers

handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles

Returns the number of handles written to handlesOut

GetControllerForGamepadIndex ( int nIndex ) : ControllerHandle_t

Returns the associated controller handle for the specified emulated gamepad

GetCurrentActionSet ( ControllerHandle_t controllerHandle ) : ControllerActionSetHandle_t
GetDigitalActionData ( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ) : ControllerDigitalActionData_t

Returns the current state of the supplied digital game action

GetDigitalActionHandle ( string pszActionName ) : ControllerDigitalActionHandle_t

ACTIONS

Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls.

GetDigitalActionOrigins ( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin originsOut ) : int

Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.

originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles

GetGamepadIndexForController ( ControllerHandle_t ulControllerHandle ) : int

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

GetGlyphForActionOrigin ( EControllerActionOrigin eOrigin ) : string

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

GetMotionData ( ControllerHandle_t controllerHandle ) : ControllerMotionData_t

Returns raw motion data from the specified controller

GetStringForActionOrigin ( EControllerActionOrigin eOrigin ) : string

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

Init ( ) : bool

Init and Shutdown must be called when starting/ending use of this interface

RunFrame ( ) : void

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 call this directly before reading controller state.

SetLEDColor ( ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ) : void

Set the controller LED color on supported controllers.

ShowAnalogActionOrigins ( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition ) : bool
ShowBindingPanel ( ControllerHandle_t controllerHandle ) : bool

Invokes the Steam overlay and brings up the binding screen

Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode

ShowDigitalActionOrigins ( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle, float flScale, float flXPosition, float flYPosition ) : bool

Attempt to display origins of given action in the controller HUD, for the currently active action set

Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode

Shutdown ( ) : bool
StopAnalogActionMomentum ( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) : void
TriggerHapticPulse ( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec ) : void

Trigger a haptic pulse on a controller

TriggerRepeatedHapticPulse ( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ) : void

Trigger a pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times.

nFlags is currently unused and reserved for future use.

TriggerVibration ( ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed ) : void

Tigger a vibration event on supported controllers.

메소드 상세

ActivateActionSet() 공개 정적인 메소드

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.

public static ActivateActionSet ( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ) : void
controllerHandle ControllerHandle_t
actionSetHandle ControllerActionSetHandle_t
리턴 void

GetActionSetHandle() 공개 정적인 메소드

ACTION SETS

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

public static GetActionSetHandle ( string pszActionSetName ) : ControllerActionSetHandle_t
pszActionSetName string
리턴 ControllerActionSetHandle_t

GetAnalogActionData() 공개 정적인 메소드

Returns the current state of these supplied analog game action

public static GetAnalogActionData ( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ) : ControllerAnalogActionData_t
controllerHandle ControllerHandle_t
analogActionHandle ControllerAnalogActionHandle_t
리턴 ControllerAnalogActionData_t

GetAnalogActionHandle() 공개 정적인 메소드

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

public static GetAnalogActionHandle ( string pszActionName ) : ControllerAnalogActionHandle_t
pszActionName string
리턴 ControllerAnalogActionHandle_t

GetAnalogActionOrigins() 공개 정적인 메소드

Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.

originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles

public static GetAnalogActionOrigins ( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin originsOut ) : int
controllerHandle ControllerHandle_t
actionSetHandle ControllerActionSetHandle_t
analogActionHandle ControllerAnalogActionHandle_t
originsOut EControllerActionOrigin
리턴 int

GetConnectedControllers() 공개 정적인 메소드

Enumerate currently connected controllers

handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles

Returns the number of handles written to handlesOut

public static GetConnectedControllers ( ControllerHandle_t handlesOut ) : int
handlesOut ControllerHandle_t
리턴 int

GetControllerForGamepadIndex() 공개 정적인 메소드

Returns the associated controller handle for the specified emulated gamepad

public static GetControllerForGamepadIndex ( int nIndex ) : ControllerHandle_t
nIndex int
리턴 ControllerHandle_t

GetCurrentActionSet() 공개 정적인 메소드

public static GetCurrentActionSet ( ControllerHandle_t controllerHandle ) : ControllerActionSetHandle_t
controllerHandle ControllerHandle_t
리턴 ControllerActionSetHandle_t

GetDigitalActionData() 공개 정적인 메소드

Returns the current state of the supplied digital game action

public static GetDigitalActionData ( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ) : ControllerDigitalActionData_t
controllerHandle ControllerHandle_t
digitalActionHandle ControllerDigitalActionHandle_t
리턴 ControllerDigitalActionData_t

GetDigitalActionHandle() 공개 정적인 메소드

ACTIONS

Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls.

public static GetDigitalActionHandle ( string pszActionName ) : ControllerDigitalActionHandle_t
pszActionName string
리턴 ControllerDigitalActionHandle_t

GetDigitalActionOrigins() 공개 정적인 메소드

Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.

originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles

public static GetDigitalActionOrigins ( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin originsOut ) : int
controllerHandle ControllerHandle_t
actionSetHandle ControllerActionSetHandle_t
digitalActionHandle ControllerDigitalActionHandle_t
originsOut EControllerActionOrigin
리턴 int

GetGamepadIndexForController() 공개 정적인 메소드

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

public static GetGamepadIndexForController ( ControllerHandle_t ulControllerHandle ) : int
ulControllerHandle ControllerHandle_t
리턴 int

GetGlyphForActionOrigin() 공개 정적인 메소드

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

public static GetGlyphForActionOrigin ( EControllerActionOrigin eOrigin ) : string
eOrigin EControllerActionOrigin
리턴 string

GetMotionData() 공개 정적인 메소드

Returns raw motion data from the specified controller

public static GetMotionData ( ControllerHandle_t controllerHandle ) : ControllerMotionData_t
controllerHandle ControllerHandle_t
리턴 ControllerMotionData_t

GetStringForActionOrigin() 공개 정적인 메소드

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

public static GetStringForActionOrigin ( EControllerActionOrigin eOrigin ) : string
eOrigin EControllerActionOrigin
리턴 string

Init() 공개 정적인 메소드

Init and Shutdown must be called when starting/ending use of this interface

public static Init ( ) : bool
리턴 bool

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 call this directly before reading controller state.

public static RunFrame ( ) : void
리턴 void

SetLEDColor() 공개 정적인 메소드

Set the controller LED color on supported controllers.

public static SetLEDColor ( ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ) : void
controllerHandle ControllerHandle_t
nColorR byte
nColorG byte
nColorB byte
nFlags uint
리턴 void

ShowAnalogActionOrigins() 공개 정적인 메소드

public static ShowAnalogActionOrigins ( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition ) : bool
controllerHandle ControllerHandle_t
analogActionHandle ControllerAnalogActionHandle_t
flScale float
flXPosition float
flYPosition float
리턴 bool

ShowBindingPanel() 공개 정적인 메소드

Invokes the Steam overlay and brings up the binding screen

Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode

public static ShowBindingPanel ( ControllerHandle_t controllerHandle ) : bool
controllerHandle ControllerHandle_t
리턴 bool

ShowDigitalActionOrigins() 공개 정적인 메소드

Attempt to display origins of given action in the controller HUD, for the currently active action set

Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode

public static ShowDigitalActionOrigins ( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle, float flScale, float flXPosition, float flYPosition ) : bool
controllerHandle ControllerHandle_t
digitalActionHandle ControllerDigitalActionHandle_t
flScale float
flXPosition float
flYPosition float
리턴 bool

Shutdown() 공개 정적인 메소드

public static Shutdown ( ) : bool
리턴 bool

StopAnalogActionMomentum() 공개 정적인 메소드

public static StopAnalogActionMomentum ( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) : void
controllerHandle ControllerHandle_t
eAction ControllerAnalogActionHandle_t
리턴 void

TriggerHapticPulse() 공개 정적인 메소드

Trigger a haptic pulse on a controller

public static TriggerHapticPulse ( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec ) : void
controllerHandle ControllerHandle_t
eTargetPad ESteamControllerPad
usDurationMicroSec ushort
리턴 void

TriggerRepeatedHapticPulse() 공개 정적인 메소드

Trigger a pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times.

nFlags is currently unused and reserved for future use.

public static TriggerRepeatedHapticPulse ( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ) : void
controllerHandle ControllerHandle_t
eTargetPad ESteamControllerPad
usDurationMicroSec ushort
usOffMicroSec ushort
unRepeat ushort
nFlags uint
리턴 void

TriggerVibration() 공개 정적인 메소드

Tigger a vibration event on supported controllers.

public static TriggerVibration ( ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed ) : void
controllerHandle ControllerHandle_t
usLeftSpeed ushort
usRightSpeed ushort
리턴 void