Ejemplo n.º 1
0
 /// <summary>
 /// <para> Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index</para>
 /// </summary>
 public static int GetGamepadIndexForController(ControllerHandle_t ulControllerHandle)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_GetGamepadIndexForController(CSteamAPIContext.GetSteamController(), ulControllerHandle));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// <para> Returns the input type for a particular handle</para>
 /// </summary>
 public static ESteamInputType GetInputTypeForHandle(ControllerHandle_t controllerHandle)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_GetInputTypeForHandle(CSteamAPIContext.GetSteamController(), controllerHandle));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// <para> Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions</para>
 /// <para> to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input</para>
 /// </summary>
 public static ControllerHandle_t GetControllerForGamepadIndex(int nIndex)
 {
     InteropHelp.TestIfAvailableClient();
     return((ControllerHandle_t)NativeMethods.ISteamController_GetControllerForGamepadIndex(CSteamAPIContext.GetSteamController(), nIndex));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// <para> Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive')</para>
 /// <para> This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in</para>
 /// <para> your state loops, instead of trying to place it in all of your state transitions.</para>
 /// </summary>
 public static void ActivateActionSet(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamController_ActivateActionSet(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// <para> Returns the current state of these supplied analog game action</para>
 /// </summary>
 public static InputAnalogActionData_t GetAnalogActionData(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_GetAnalogActionData(CSteamAPIContext.GetSteamController(), controllerHandle, analogActionHandle));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// <para> Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EControllerActionOrigin_None</para>
 /// </summary>
 public static EControllerActionOrigin TranslateActionOrigin(ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_TranslateActionOrigin(CSteamAPIContext.GetSteamController(), eDestinationInputType, eSourceOrigin));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// <para> Synchronize API state with the latest Steam Controller inputs available. This</para>
 /// <para> is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest</para>
 /// <para> possible latency, you call this directly before reading controller state. This must</para>
 /// <para> be called from somewhere before GetConnectedControllers will return any handles</para>
 /// </summary>
 public static void RunFrame()
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamController_RunFrame(CSteamAPIContext.GetSteamController());
 }
Ejemplo n.º 8
0
 /// <summary>
 /// <para> Returns raw motion data from the specified controller</para>
 /// </summary>
 public static ControllerMotionData_t GetMotionData(ControllerHandle_t controllerHandle)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_GetMotionData(CSteamAPIContext.GetSteamController(), controllerHandle));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// <para> Trigger a pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times.</para>
 /// <para> nFlags is currently unused and reserved for future use.</para>
 /// </summary>
 public static void TriggerRepeatedHapticPulse(ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamController_TriggerRepeatedHapticPulse(CSteamAPIContext.GetSteamController(), controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// <para> 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.</para>
 /// <para> originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to</para>
 /// <para> the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.</para>
 /// </summary>
 public static int GetAnalogActionOrigins(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin[] originsOut)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_GetAnalogActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, actionSetHandle, analogActionHandle, originsOut));
 }
Ejemplo n.º 11
0
 public static void StopAnalogActionMomentum(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamController_StopAnalogActionMomentum(CSteamAPIContext.GetSteamController(), controllerHandle, eAction);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// <para> Enumerate currently active layers</para>
 /// <para> handlesOut should point to a STEAM_CONTROLLER_MAX_ACTIVE_LAYERS sized array of ControllerActionSetHandle_t handles.</para>
 /// <para> Returns the number of handles written to handlesOut</para>
 /// </summary>
 public static int GetActiveActionSetLayers(ControllerHandle_t controllerHandle, ControllerActionSetHandle_t[] handlesOut)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_GetActiveActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle, handlesOut));
 }
Ejemplo n.º 13
0
 public static void DeactivateAllActionSetLayers(ControllerHandle_t controllerHandle)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamController_DeactivateAllActionSetLayers(CSteamAPIContext.GetSteamController(), controllerHandle);
 }
Ejemplo n.º 14
0
 public static bool ShowAnalogActionOrigins(ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_ShowAnalogActionOrigins(CSteamAPIContext.GetSteamController(), controllerHandle, analogActionHandle, flScale, flXPosition, flYPosition));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// <para> Get a local path to art for on-screen glyph for a particular Xbox controller origin.</para>
 /// </summary>
 public static string GetGlyphForXboxOrigin(EXboxOrigin eOrigin)
 {
     InteropHelp.TestIfAvailableClient();
     return(InteropHelp.PtrToStringUTF8(NativeMethods.ISteamController_GetGlyphForXboxOrigin(CSteamAPIContext.GetSteamController(), eOrigin)));
 }
Ejemplo n.º 16
0
 /// <summary>
 /// <para> Trigger a vibration event on supported controllers.</para>
 /// </summary>
 public static void TriggerVibration(ControllerHandle_t controllerHandle, ushort usLeftSpeed, ushort usRightSpeed)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamController_TriggerVibration(CSteamAPIContext.GetSteamController(), controllerHandle, usLeftSpeed, usRightSpeed);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// <para> Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for</para>
 /// <para> non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration</para>
 /// </summary>
 public static EControllerActionOrigin GetActionOriginFromXboxOrigin(ControllerHandle_t controllerHandle, EXboxOrigin eOrigin)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_GetActionOriginFromXboxOrigin(CSteamAPIContext.GetSteamController(), controllerHandle, eOrigin));
 }
Ejemplo n.º 18
0
 /// <summary>
 /// <para> Set the controller LED color on supported controllers.</para>
 /// </summary>
 public static void SetLEDColor(ControllerHandle_t controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamController_SetLEDColor(CSteamAPIContext.GetSteamController(), controllerHandle, nColorR, nColorG, nColorB, nFlags);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// <para> Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device</para>
 /// </summary>
 public static bool GetControllerBindingRevision(ControllerHandle_t controllerHandle, out int pMajor, out int pMinor)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_GetControllerBindingRevision(CSteamAPIContext.GetSteamController(), controllerHandle, out pMajor, out pMinor));
 }
Ejemplo n.º 20
0
 /// <summary>
 /// <para>-----------------------------------------------------------------------------</para>
 /// <para> Utility functions availible without using the rest of Steam Input API</para>
 /// <para>-----------------------------------------------------------------------------</para>
 /// <para> Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode</para>
 /// <para> If the user is not in Big Picture Mode it will open up the binding in a new window</para>
 /// </summary>
 public static bool ShowBindingPanel(ControllerHandle_t controllerHandle)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_ShowBindingPanel(CSteamAPIContext.GetSteamController(), controllerHandle));
 }
Ejemplo n.º 21
0
 /// <summary>
 /// <para>-----------------------------------------------------------------------------</para>
 /// <para> ACTION SETS</para>
 /// <para>-----------------------------------------------------------------------------</para>
 /// <para> Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls.</para>
 /// </summary>
 public static ControllerActionSetHandle_t GetActionSetHandle(string pszActionSetName)
 {
     InteropHelp.TestIfAvailableClient();
     using (var pszActionSetName2 = new InteropHelp.UTF8StringHandle(pszActionSetName)) {
         return((ControllerActionSetHandle_t)NativeMethods.ISteamController_GetActionSetHandle(CSteamAPIContext.GetSteamController(), pszActionSetName2));
     }
 }
Ejemplo n.º 22
0
 public static bool Shutdown()
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamController_Shutdown(CSteamAPIContext.GetSteamController()));
 }
Ejemplo n.º 23
0
 public static ControllerActionSetHandle_t GetCurrentActionSet(ControllerHandle_t controllerHandle)
 {
     InteropHelp.TestIfAvailableClient();
     return((ControllerActionSetHandle_t)NativeMethods.ISteamController_GetCurrentActionSet(CSteamAPIContext.GetSteamController(), controllerHandle));
 }
Ejemplo n.º 24
0
 public static ControllerDigitalActionHandle_t GetDigitalActionHandle(string pszActionName)
 {
     InteropHelp.TestIfAvailableClient();
     using InteropHelp.UTF8StringHandle pszActionName2 = new InteropHelp.UTF8StringHandle(pszActionName);
     return((ControllerDigitalActionHandle_t)NativeMethods.ISteamController_GetDigitalActionHandle(CSteamAPIContext.GetSteamController(), pszActionName2));
 }