diff --git a/library/Makefile b/library/Makefile index 416dc31..dbac57f 100644 --- a/library/Makefile +++ b/library/Makefile @@ -1,4 +1,5 @@ -makeall: +SteamworksPy.so: SteamworksPy.cpp g++ -std=c++11 -o SteamworksPy.so -shared -fPIC SteamworksPy.cpp -l steam_api -L. + clean: rm SteamworksPy.so diff --git a/library/SteamworksPy.cpp b/library/SteamworksPy.cpp index 49013ec..3a7017c 100644 --- a/library/SteamworksPy.cpp +++ b/library/SteamworksPy.cpp @@ -13,6 +13,7 @@ #include "TargetConditionals.h" #define SW_PY extern "C" __attribute__ ((visibility("default"))) #elif defined( __linux__ ) +#include #include "sdk/steam/steam_api.h" #define SW_PY extern "C" __attribute__ ((visibility("default"))) #else @@ -665,7 +666,7 @@ SW_PY uint64_t GetCurrentActionSet(uint64_t controllerHandle){ } return (uint64_t) SteamInput()->GetCurrentActionSet((InputHandle_t) controllerHandle); } -// Get the input type (device model) for the specified controller. +// Get the input type (device model) for the specified controller. SW_PY uint64_t GetInputTypeForHandle(uint64_t controllerHandle){ if(SteamInput() == NULL){ return 0; @@ -736,6 +737,13 @@ SW_PY bool ControllerInit(bool bExplicitlyCallRunFrame) { return SteamInput()->Init(bExplicitlyCallRunFrame); } +SW_PY bool SetInputActionManifestFilePath(const char *path) { + if (SteamInput() == NULL) { + return false; + } + return SteamInput()->SetInputActionManifestFilePath(path); +} + // Syncronize controllers. SW_PY void RunFrame() { if (SteamInput() == NULL) { @@ -1467,4 +1475,5 @@ SW_PY void MicroTxn_SetAuthorizationResponseCallback(MicroTxnAuthorizationRespon return; } microtxn.SetAuthorizationResponseCallback(callback); -} \ No newline at end of file +} + diff --git a/steamworks/interfaces/input.py b/steamworks/interfaces/input.py index e5820e5..0aa9af6 100644 --- a/steamworks/interfaces/input.py +++ b/steamworks/interfaces/input.py @@ -12,6 +12,9 @@ def __init__(self, steam: object): def Init(self, explicitlyCallRunFrame=False): return self.steam.ControllerInit(explicitlyCallRunFrame) + def SetInputActionManifestFilePath(self, path): + return self.steam.SetInputActionManifestFilePath(path.encode()) + def RunFrame(self): return self.steam.RunFrame() diff --git a/steamworks/methods.py b/steamworks/methods.py index 9567d8e..4d22035 100644 --- a/steamworks/methods.py +++ b/steamworks/methods.py @@ -135,6 +135,10 @@ class InputDigitalActionData_t(Structure): 'restype': None, 'argtypes': [c_uint64] }, + 'SetInputActionManifestFilePath': { + 'restype': bool, + 'argtypes': [c_char_p] + }, 'ActivateActionSet': { 'restype': None, 'argtypes': [c_uint64, c_uint64]