From d252f03f8d116937cbf02474bbb1ddbe1ae05696 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 20 Oct 2026 16:14:54 +0200
Subject: [PATCH] Bump GameInput to 4.0.302
---
src/core/windows/gameinput/gameinput.cpp | 119 ++++---
src/core/windows/gameinput/gameinput.h | 417 +++++++++++++++--------
2 files changed, 351 insertions(+), 185 deletions(-)
diff --git a/src/core/windows/gameinput/gameinput.cpp b/src/core/windows/gameinput/gameinput.cpp
index 16483316c065a..aa7f2009c7d64 100644
--- a/src/core/windows/gameinput/gameinput.cpp
+++ b/src/core/windows/gameinput/gameinput.cpp
@@ -62,6 +62,40 @@
namespace GameInput {
+//
+// GDK Compatibility
+//
+
+/* SDL modifications: use typedef for c++98 copatibility */
+typedef DWORD (WINAPI * Gi_GetFileVersionInfoSizeWFn)(
+ _In_ LPCWSTR lptstrFilename,
+ _Out_opt_ LPDWORD lpdwHandle);
+
+typedef BOOL (WINAPI * Gi_GetFileVersionInfoWFn)(
+ _In_ LPCWSTR lptstrFilename,
+ _Reserved_ DWORD dwHandle,
+ _In_ DWORD dwLen,
+ _Out_writes_bytes_(dwLen) LPVOID lpData);
+
+typedef BOOL (WINAPI * Gi_VerQueryValueWFn)(
+ _In_ LPCVOID pBlock,
+ _In_ LPCWSTR lpSubBlock,
+ _Outptr_result_buffer_(_Inexpressible_("buffer can be PWSTR or DWORD*")) LPVOID* lplpBuffer,
+ _Out_ PUINT puLen);
+
+typedef LSTATUS (WINAPI * Gi_RegGetValueWFn)(
+ _In_ HKEY hkey,
+ _In_opt_ LPCWSTR lpSubKey,
+ _In_opt_ LPCWSTR lpValue,
+ _In_ DWORD dwFlags,
+ _Out_opt_ LPDWORD pdwType,
+ _Out_writes_bytes_to_opt_(*pcbData, *pcbData) PVOID pvData,
+ _Inout_opt_ LPDWORD pcbData);
+
+static const DWORD GI_RRF_RT_REG_SZ = 0x00000002;
+static const DWORD GI_RRF_SUBKEY_WOW6432KEY = 0x00020000;
+
+
//
// Constants
//
@@ -93,15 +127,6 @@ static HMODULE g_versionDll = nullptr;
#define RETURN_LAST_ERROR_IF(condition) { bool _condition = (condition); if(_condition) { RETURN_WIN32(GetLastError()); } }
#define RETURN_LAST_ERROR_IF_NULL(ptr) RETURN_LAST_ERROR_IF((ptr) == NULL)
-#define RETURN_NTSTATUS(status) { NTSTATUS _value = (status); return NT_SUCCESS(_value) ? S_OK : (HRESULT)((_value) | FACILITY_NT_BIT); }
-#define RETURN_IF_NTSTATUS_FAILED(status) { NTSTATUS _status = (status); if (!NT_SUCCESS(_status)) { RETURN_NTSTATUS(_status); } }
-
-#define FAIL_FAST_HR(hr) { __fastfail(hr); }
-#define FAIL_FAST() FAIL_FAST_HR(E_UNEXPECTED)
-#define FAIL_FAST_IF(condition) { if (condition) { FAIL_FAST_HR(E_UNEXPECTED); } }
-#define FAIL_FAST_IF_FAILED(x) { HRESULT _hr = (x); if (FAILED(_hr)) { FAIL_FAST_HR(_hr); } }
-#define FAIL_FAST_IF_WIN32_BOOL_FALSE(condition) { if (condition == FALSE) { FAIL_FAST_HR(HRESULT_FROM_WIN32(GetLastError())); } }
-
//
// Containers
@@ -112,7 +137,7 @@ class Vector
{
public:
Vector()
- : m_data(nullptr)
+ : m_data(nullptr) /* SDL modification: c++98 compatibility */
, m_count(0)
, m_capacity(0)
{
@@ -246,11 +271,6 @@ class String
return m_string;
}
- const T& GetFront() const noexcept
- {
- return m_string[0];
- }
-
const T& GetBack() const noexcept
{
return m_string[m_string.GetCount() - 1];
@@ -260,8 +280,7 @@ class String
Vector<T> m_string;
};
-typedef String<wchar_t> WString;
-typedef String<char> AString;
+typedef String<wchar_t> WString; /* SDL modification: c++98 compatibility */
//
@@ -291,7 +310,7 @@ static HRESULT LoadSystemModuleProc(
if (*module == nullptr)
{
- *module = LoadLibraryEx(path, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
+ *module = LoadLibraryExW(path, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
RETURN_LAST_ERROR_IF_NULL(*module);
}
@@ -303,11 +322,11 @@ static HRESULT LoadSystemModuleProc(
static HRESULT GetSystemDirectory(
_Inout_ WString* systemDir) noexcept
{
- uint32_t length = ::GetSystemDirectory(nullptr, 0);
+ uint32_t length = ::GetSystemDirectoryW(nullptr, 0);
RETURN_LAST_ERROR_IF(length == 0);
RETURN_IF_FAILED(systemDir->Resize(length));
- length = ::GetSystemDirectory(*systemDir, length) + 1;
+ length = ::GetSystemDirectoryW(*systemDir, length) + 1;
RETURN_LAST_ERROR_IF(length == 0);
RETURN_IF_FAILED(systemDir->Resize(length));
@@ -328,7 +347,7 @@ static HRESULT GetApplicationDirectory(
RETURN_IF_FAILED(appDir->Resize(capacity));
SetLastError(ERROR_SUCCESS);
- length = ::GetModuleFileName(nullptr, *appDir, capacity + 1);
+ length = ::GetModuleFileNameW(nullptr, *appDir, capacity + 1);
RETURN_LAST_ERROR_IF(length == 0);
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
@@ -360,11 +379,18 @@ static HRESULT GetApplicationDirectory(
static HRESULT GetRedistDirectory(
_Inout_ WString* redistDir) noexcept
{
- static const wchar_t* RedistDirRegPath = L"SOFTWARE\\Microsoft\\GameInput";
- static const wchar_t* RedistDirValueName = L"RedistDir";
+ static const wchar_t RedistDirRegPath[] = L"SOFTWARE\\Microsoft\\GameInput"; /* SDL modification: c++98 compatibility */
+
+#if defined(_M_IX86)
+ // RedistDir names the 64-bit folder and cannot be repurposed - copies of this file
+ // are statically linked into shipped titles. RedistDirX86 is additive instead, so
+ // an installer predating it simply fails the lookup and the caller moves on.
+ static const wchar_t RedistDirValueName[] = L"RedistDirX86"; /* SDL modification: c++98 compatibility */
+#else
+ static const wchar_t RedistDirValueName[] = L"RedistDir"; /* SDL modification: c++98 compatibility */
+#endif
- typedef LONG (WINAPI *RegGetValueW_t)(HKEY,LPCWSTR,LPCWSTR,DWORD,LPDWORD,PVOID,LPDWORD);
- RegGetValueW_t regGetValue = nullptr;
+ Gi_RegGetValueWFn regGetValue = nullptr;
RETURN_IF_FAILED(LoadSystemModuleProc(
&g_advapi32Dll,
L"advapi32.dll",
@@ -376,7 +402,7 @@ static HRESULT GetRedistDirectory(
HKEY_LOCAL_MACHINE,
RedistDirRegPath,
RedistDirValueName,
- RRF_RT_REG_SZ | RRF_SUBKEY_WOW6432KEY,
+ GI_RRF_RT_REG_SZ | GI_RRF_SUBKEY_WOW6432KEY,
nullptr,
nullptr,
&cbSize)));
@@ -387,7 +413,7 @@ static HRESULT GetRedistDirectory(
HKEY_LOCAL_MACHINE,
RedistDirRegPath,
RedistDirValueName,
- RRF_RT_REG_SZ | RRF_SUBKEY_WOW6432KEY,
+ GI_RRF_RT_REG_SZ | GI_RRF_SUBKEY_WOW6432KEY,
nullptr,
*redistDir,
&cbSize)));
@@ -403,24 +429,21 @@ static HRESULT GetFileVersion(
{
*version = 0;
- typedef DWORD (WINAPI *GetFileVersionInfoSizeW_t)(LPCWSTR,LPDWORD);
- GetFileVersionInfoSizeW_t getFileVersionInfoSize = nullptr;
+ Gi_GetFileVersionInfoSizeWFn getFileVersionInfoSize = nullptr;
RETURN_IF_FAILED(LoadSystemModuleProc(
&g_versionDll,
L"version.dll",
"GetFileVersionInfoSizeW",
&getFileVersionInfoSize));
- typedef BOOL (WINAPI *GetFileVersionInfoW_t)(LPCWSTR,DWORD,DWORD,LPVOID);
- GetFileVersionInfoW_t getFileVersionInfo = nullptr;
+ Gi_GetFileVersionInfoWFn getFileVersionInfo = nullptr;
RETURN_IF_FAILED(LoadSystemModuleProc(
&g_versionDll,
L"version.dll",
"GetFileVersionInfoW",
&getFileVersionInfo));
- typedef BOOL (WINAPI *VerQueryValueW_t)(LPCVOID,LPCWSTR,LPVOID*,PUINT);
- VerQueryValueW_t verQueryValue = nullptr;
+ Gi_VerQueryValueWFn verQueryValue = nullptr;
RETURN_IF_FAILED(LoadSystemModuleProc(
&g_versionDll,
L"version.dll",
@@ -539,23 +562,43 @@ static HRESULT LoadGameInputDll(
SUCCEEDED(PathJoin(systemDir, L"GameInput.dll", &inboxPath)) &&
GetFileInfo(inboxPath, &inboxVersion);
+ // GameInputRedist.dll can be found in System32 and Program Files;
+ // check both locations for improved compatibility.
+
+ WString redistDir;
WString redistPath;
uint64_t redistVersion = 0;
+
+#if defined(_M_IX86)
+ // Only the 64-bit redist is ever deployed to the system directory, and copies of it
+ // exist in SysWOW64, which is where a 32-bit process resolves that directory. Probe
+ // the architecture-specific Program Files location first so a wrong-bitness file
+ // cannot mask it and leave the loader with a module it is unable to load.
+
bool validRedist =
- SUCCEEDED(PathJoin(systemDir, L"GameInputRedist.dll", &redistPath)) &&
+ SUCCEEDED(GetRedistDirectory(&redistDir)) &&
+ SUCCEEDED(PathJoin(redistDir, L"GameInputRedist.dll", &redistPath)) &&
GetFileInfo(redistPath, &redistVersion);
if (!validRedist)
{
- // GameInputRedist.dll can be found in System32 and Program Files;
- // check both locations for improved compatibility.
+ validRedist =
+ SUCCEEDED(PathJoin(systemDir, L"GameInputRedist.dll", &redistPath)) &&
+ GetFileInfo(redistPath, &redistVersion);
+ }
+#else
+ bool validRedist =
+ SUCCEEDED(PathJoin(systemDir, L"GameInputRedist.dll", &redistPath)) &&
+ GetFileInfo(redistPath, &redistVersion);
- WString redistDir;
+ if (!validRedist)
+ {
validRedist =
SUCCEEDED(GetRedistDirectory(&redistDir)) &&
SUCCEEDED(PathJoin(redistDir, L"GameInputRedist.dll", &redistPath)) &&
GetFileInfo(redistPath, &redistVersion);
}
+#endif
WString appDir;
WString sideloadedPath;
@@ -589,7 +632,7 @@ static HRESULT LoadGameInputDll(
RETURN_HR_IF_NULL(HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), path);
- *module = LoadLibrary(path);
+ *module = LoadLibraryW(path);
RETURN_LAST_ERROR_IF_NULL(*module);
return S_OK;
diff --git a/src/core/windows/gameinput/gameinput.h b/src/core/windows/gameinput/gameinput.h
index 0193878f656ac..fec7d52258044 100644
--- a/src/core/windows/gameinput/gameinput.h
+++ b/src/core/windows/gameinput/gameinput.h
@@ -32,9 +32,9 @@
#pragma region Application Family or OneCore Family or Games Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM | WINAPI_PARTITION_GAMES)
-#define GAMEINPUT_API_VERSION 3
+#define GAMEINPUT_API_VERSION 4
-namespace GameInput { namespace v3 {
+namespace GameInput { namespace v4 {
enum GameInputKind
{
@@ -51,30 +51,22 @@ enum GameInputKind
GameInputKindFlightStick = 0x00020000,
GameInputKindGamepad = 0x00040000,
GameInputKindRacingWheel = 0x00080000,
+ GameInputKindLighting = 0x00100000,
+ GameInputKindSystemButton = 0x00200000,
+ GameInputKindTouch = 0x00400000,
};
DEFINE_ENUM_FLAG_OPERATORS(GameInputKind)
-enum GameInputEnumerationKind
+enum GameInputDeviceEvent
{
- GameInputNoEnumeration = 0,
- GameInputAsyncEnumeration = 1,
- GameInputBlockingEnumeration = 2
+ GameInputDeviceEventConnected = 0,
+ GameInputDeviceEventDisconnected = 1,
+ GameInputDeviceEventKeyboardLayoutUpdated = 2,
+ GameInputDeviceEventHapticInfoUpdated = 3,
+ GameInputDeviceEventXInputIndexUpdated = 4,
};
-enum GameInputFocusPolicy
-{
- GameInputDefaultFocusPolicy = 0x00000000,
- GameInputExclusiveForegroundInput = 0x00000002,
- GameInputExclusiveForegroundGuideButton = 0x00000008,
- GameInputExclusiveForegroundShareButton = 0x00000020,
- GameInputEnableBackgroundInput = 0x00000040,
- GameInputEnableBackgroundGuideButton = 0x00000080,
- GameInputEnableBackgroundShareButton = 0x00000100
-};
-
-DEFINE_ENUM_FLAG_OPERATORS(GameInputFocusPolicy)
-
enum GameInputSwitchKind
{
GameInputUnknownSwitchKind = -1,
@@ -150,21 +142,23 @@ enum GameInputSensorAccuracy
enum GameInputArcadeStickButtons
{
- GameInputArcadeStickNone = 0x00000000,
- GameInputArcadeStickMenu = 0x00000001,
- GameInputArcadeStickView = 0x00000002,
- GameInputArcadeStickUp = 0x00000004,
- GameInputArcadeStickDown = 0x00000008,
- GameInputArcadeStickLeft = 0x00000010,
- GameInputArcadeStickRight = 0x00000020,
- GameInputArcadeStickAction1 = 0x00000040,
- GameInputArcadeStickAction2 = 0x00000080,
- GameInputArcadeStickAction3 = 0x00000100,
- GameInputArcadeStickAction4 = 0x00000200,
- GameInputArcadeStickAction5 = 0x00000400,
- GameInputArcadeStickAction6 = 0x00000800,
- GameInputArcadeStickSpecial1 = 0x00001000,
- GameInputArcadeStickSpecial2 = 0x00002000
+ GameInputArcadeStickNone = 0x00000000,
+ GameInputArcadeStickMenu = 0x00000001,
+ GameInputArcadeStickView = 0x00000002,
+ GameInputArcadeStickUp = 0x00000004,
+ GameInputArcadeStickDown = 0x00000008,
+ GameInputArcadeStickLeft = 0x00000010,
+ GameInputArcadeStickRight = 0x00000020,
+ GameInputArcadeStickAction1 = 0x00000040,
+ GameInputArcadeStickAction2 = 0x00000080,
+ GameInputArcadeStickAction3 = 0x00000100,
+ GameInputArcadeStickAction4 = 0x00000200,
+ GameInputArcadeStickAction5 = 0x00000400,
+ GameInputArcadeStickAction6 = 0x00000800,
+ GameInputArcadeStickSpecial1 = 0x00001000,
+ GameInputArcadeStickSpecial2 = 0x00002000,
+ GameInputArcadeStickLeftThumbstick = 0x00004000,
+ GameInputArcadeStickRightThumbstick = 0x00008000
};
DEFINE_ENUM_FLAG_OPERATORS(GameInputArcadeStickButtons)
@@ -231,6 +225,7 @@ enum GameInputRawDeviceReportKind
{
GameInputRawInputReport = 0,
GameInputRawOutputReport = 1,
+ GameInputRawFeatureReport = 2,
};
// Gamepad modules (Groupings of gamepad elements commonly found together)
@@ -363,16 +358,6 @@ enum GameInputRacingWheelAxes
DEFINE_ENUM_FLAG_OPERATORS(GameInputRacingWheelAxes)
-enum GameInputDeviceStatus
-{
- GameInputDeviceNoStatus = 0x00000000,
- GameInputDeviceConnected = 0x00000001,
- GameInputDeviceHapticInfoReady = 0x00200000,
- GameInputDeviceAnyStatus = 0xFFFFFFFF
-};
-
-DEFINE_ENUM_FLAG_OPERATORS(GameInputDeviceStatus)
-
enum GameInputDeviceFamily
{
GameInputFamilyVirtual = -1,
@@ -384,6 +369,22 @@ enum GameInputDeviceFamily
GameInputFamilyAggregate = 5,
};
+enum GameInputLightingGroups
+{
+ GameInputLightingGroupUnknown = 0x00000000,
+ GameInputLightingGroupLeftThumbstick = 0x00000001,
+ GameInputLightingGroupRightThumbstick = 0x00000002,
+ GameInputLightingGroupDPad = 0x00000004,
+ GameInputLightingGroupFaceButtons = 0x00000008,
+ GameInputLightingGroupCenterLight = 0x00000010,
+ GameInputLightingGroupKeyboardKey = 0x00000020,
+ GameInputLightingGroupLeftHeadset = 0x00000040,
+ GameInputLightingGroupRightHeadset = 0x00000080,
+ GameInputLightingGroupAll = 0xFFFFFFFF,
+};
+
+DEFINE_ENUM_FLAG_OPERATORS(GameInputLightingGroups)
+
enum GameInputLabel
{
GameInputLabelUnknown = -1,
@@ -511,6 +512,22 @@ enum GameInputLabel
GameInputLabelPaddleLeft2 = 122,
GameInputLabelPaddleRight1 = 123,
GameInputLabelPaddleRight2 = 124,
+ GameInputLabelTouchpadButton = 125,
+ GameInputLabelLeftThumbstickX = 126,
+ GameInputLabelLeftThumbstickY = 127,
+ GameInputLabelRightThumbstickX = 128,
+ GameInputLabelRightThumbstickY = 129,
+ GameInputLabelRoll = 130,
+ GameInputLabelPitch = 131,
+ GameInputLabelYaw = 132,
+ GameInputLabelThrottle = 133,
+ GameInputLabelSteering = 134,
+ GameInputLabelBrake = 135,
+ GameInputLabelClutch = 136,
+ GameInputLabelHandbrake = 137,
+ GameInputLabelPatternShifter = 138,
+ GameInputLabelFirePrimary = 139,
+ GameInputLabelFireSecondary = 140,
};
enum GameInputFeedbackAxes
@@ -568,21 +585,18 @@ interface IGameInputForceFeedbackEffect;
interface IGameInputMapper;
typedef uint64_t GameInputCallbackToken;
-// start SDL modifications
-#if 0
-// end SDL modifications
+
constexpr GUID GAMEINPUT_HAPTIC_LOCATION_NONE = { 0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } };
constexpr GUID GAMEINPUT_HAPTIC_LOCATION_GRIP_LEFT = { 0x08c707c2, 0x66bb, 0x406c, { 0xa8, 0x4a, 0xdf, 0xe0, 0x85, 0x12, 0x0a, 0x92 } };
constexpr GUID GAMEINPUT_HAPTIC_LOCATION_GRIP_RIGHT = { 0x155a0b77, 0x8bb2, 0x40db, { 0x86, 0x90, 0xb6, 0xd4, 0x11, 0x26, 0xdf, 0xc1 } };
constexpr GUID GAMEINPUT_HAPTIC_LOCATION_TRIGGER_LEFT = { 0x8de4d896, 0x5559, 0x4081, { 0x86, 0xe5, 0x17, 0x24, 0xcc, 0x07, 0xc6, 0xbc } };
constexpr GUID GAMEINPUT_HAPTIC_LOCATION_TRIGGER_RIGHT = { 0xff0cb557, 0x3af5, 0x406b, { 0x8b, 0x0f, 0x55, 0x5a, 0x2d, 0x92, 0xa2, 0x20 } };
-// start SDL modifications
-#endif
-// end SDL modifications
const uint32_t GAMEINPUT_HAPTIC_MAX_LOCATIONS = 8;
const uint32_t GAMEINPUT_HAPTIC_MAX_AUDIO_ENDPOINT_ID_SIZE = 256;
+const uint32_t GAMEINPUT_LIGHTING_GROUP_ORDER_INDEX_ALL = 0xFFFFFFFF;
+
typedef void (CALLBACK* GameInputReadingCallback)(
_In_ GameInputCallbackToken callbackToken,
_In_ void* context,
@@ -591,26 +605,8 @@ typedef void (CALLBACK* GameInputReadingCallback)(
typedef void (CALLBACK* GameInputDeviceCallback)(
_In_ GameInputCallbackToken callbackToken,
_In_ void* context,
- _In_ IGameInputDevice* device,
- _In_ uint64_t timestamp,
- _In_ GameInputDeviceStatus currentStatus,
- _In_ GameInputDeviceStatus previousStatus);
-
-typedef void (CALLBACK* GameInputSystemButtonCallback)(
- _In_ GameInputCallbackToken callbackToken,
- _In_ void* context,
- _In_ IGameInputDevice* device,
- _In_ uint64_t timestamp,
- _In_ GameInputSystemButtons currentButtons,
- _In_ GameInputSystemButtons previousButtons);
-
-typedef void (CALLBACK* GameInputKeyboardLayoutCallback)(
- _In_ GameInputCallbackToken callbackToken,
- _In_ void* context,
- _In_ IGameInputDevice* device,
- _In_ uint64_t timestamp,
- _In_ uint32_t currentLayout,
- _In_ uint32_t previousLayout);
+ _In_ GameInputDeviceEvent deviceEvent,
+ _In_ IGameInputDevice* device);
struct GameInputKeyState
{
@@ -663,6 +659,15 @@ struct GameInputSensorsState
float orientationZ;
};
+struct GameInputTouchContact
+{
+ uint64_t contactId;
+ int32_t screenX;
+ int32_t screenY;
+ uint32_t padX;
+ uint32_t padY;
+};
+
struct GameInputArcadeStickState
{
GameInputArcadeStickButtons buttons;
@@ -714,16 +719,6 @@ struct GameInputControllerSwitchInfo
GameInputSwitchKind kind;
};
-struct GameInputControllerInfo
-{
- uint32_t controllerAxisCount;
- _Field_size_full_(controllerAxisCount) const GameInputLabel* controllerAxisLabels;
- uint32_t controllerButtonCount;
- _Field_size_full_(controllerButtonCount) const GameInputLabel* controllerButtonLabels;
- uint32_t controllerSwitchCount;
- _Field_size_full_(controllerSwitchCount) const GameInputControllerSwitchInfo* controllerSwitchInfo;
-};
-
struct GameInputKeyboardInfo
{
GameInputKeyboardKind kind;
@@ -748,6 +743,21 @@ struct GameInputSensorsInfo
GameInputSensorsKind supportedSensors;
};
+enum GameInputTouchSurfaceType
+{
+ GameInputTouchSurfaceTypeUnknown = 0,
+ GameInputTouchSurfaceTypeTouchscreen = 1,
+ GameInputTouchSurfaceTypeTouchpad = 2,
+};
+
+struct GameInputTouchSurfaceInfo
+{
+ uint32_t maxContactCount;
+ uint32_t padWidth;
+ uint32_t padHeight;
+ GameInputTouchSurfaceType type;
+};
+
struct GameInputArcadeStickInfo
{
GameInputLabel menuButtonLabel;
@@ -764,6 +774,8 @@ struct GameInputArcadeStickInfo
GameInputLabel actionButton6Label;
GameInputLabel specialButton1Label;
GameInputLabel specialButton2Label;
+ GameInputLabel leftThumbstickButtonLabel;
+ GameInputLabel rightThumbstickButtonLabel;
uint32_t extraButtonCount;
uint32_t extraAxisCount;
};
@@ -784,6 +796,10 @@ struct GameInputFlightStickInfo
GameInputLabel yButtonLabel;
GameInputLabel leftShoulderButtonLabel;
GameInputLabel rightShoulderButtonLabel;
+ GameInputLabel rollLabel;
+ GameInputLabel pitchLabel;
+ GameInputLabel yawLabel;
+ GameInputLabel throttleLabel;
uint32_t extraButtonCount;
uint32_t extraAxisCount;
};
@@ -807,6 +823,16 @@ struct GameInputGamepadInfo
GameInputLabel rightShoulderButtonLabel;
GameInputLabel leftThumbstickButtonLabel;
GameInputLabel rightThumbstickButtonLabel;
+ GameInputLabel paddleLeft1Label;
+ GameInputLabel paddleLeft2Label;
+ GameInputLabel paddleRight1Label;
+ GameInputLabel paddleRight2Label;
+ GameInputLabel leftTriggerLabel;
+ GameInputLabel rightTriggerLabel;
+ GameInputLabel leftThumbstickXLabel;
+ GameInputLabel leftThumbstickYLabel;
+ GameInputLabel rightThumbstickXLabel;
+ GameInputLabel rightThumbstickYLabel;
uint32_t extraButtonCount;
uint32_t extraAxisCount;
};
@@ -827,6 +853,11 @@ struct GameInputRacingWheelInfo
GameInputLabel yButtonLabel;
GameInputLabel leftThumbstickButtonLabel;
GameInputLabel rightThumbstickButtonLabel;
+ GameInputLabel steeringLabel;
+ GameInputLabel throttleLabel;
+ GameInputLabel brakeLabel;
+ GameInputLabel clutchLabel;
+ GameInputLabel handbrakeLabel;
bool hasClutch;
bool hasHandbrake;
bool hasPatternShifter;
@@ -860,43 +891,6 @@ struct GameInputRawDeviceReportInfo
uint32_t size;
};
-struct GameInputDeviceInfo
-{
- uint16_t vendorId;
- uint16_t productId;
- uint16_t revisionNumber;
- GameInputUsage usage;
- GameInputVersion hardwareVersion;
- GameInputVersion firmwareVersion;
- APP_LOCAL_DEVICE_ID deviceId;
- APP_LOCAL_DEVICE_ID deviceRootId;
- GameInputDeviceFamily deviceFamily;
- GameInputKind supportedInput;
- GameInputRumbleMotors supportedRumbleMotors;
- GameInputSystemButtons supportedSystemButtons;
- GUID containerId;
- const char* displayName;
- const char* pnpPath;
-
- _Field_size_full_opt_(1) const GameInputKeyboardInfo* keyboardInfo;
- _Field_size_full_opt_(1) const GameInputMouseInfo* mouseInfo;
- _Field_size_full_opt_(1) const GameInputSensorsInfo* sensorsInfo;
- _Field_size_full_opt_(1) const GameInputControllerInfo* controllerInfo;
- _Field_size_full_opt_(1) const GameInputArcadeStickInfo* arcadeStickInfo;
- _Field_size_full_opt_(1) const GameInputFlightStickInfo* flightStickInfo;
- _Field_size_full_opt_(1) const GameInputGamepadInfo* gamepadInfo;
- _Field_size_full_opt_(1) const GameInputRacingWheelInfo* racingWheelInfo;
-
- uint32_t forceFeedbackMotorCount;
- _Field_size_full_(forceFeedbackMotorCount) const GameInputForceFeedbackMotorInfo* forceFeedbackMotorInfo;
-
- uint32_t inputReportCount;
- _Field_size_full_opt_(inputReportCount) const GameInputRawDeviceReportInfo* inputReportInfo;
-
- uint32_t outputReportCount;
- _Field_size_full_opt_(outputReportCount) const GameInputRawDeviceReportInfo* outputReportInfo;
-};
-
struct GameInputHapticInfo
{
_Field_z_ wchar_t audioEndpointId[GAMEINPUT_HAPTIC_MAX_AUDIO_ENDPOINT_ID_SIZE];
@@ -987,6 +981,13 @@ struct GameInputRumbleParams
float rightTrigger;
};
+struct GameInputColor
+{
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+};
+
enum GameInputElementKind
{
GameInputElementKindNone = 0,
@@ -1025,9 +1026,9 @@ struct GameInputButtonMapping
GameInputSwitchPosition switchPosition;
};
-const IID IID_IGameInput = {0x20efc1c7, 0x5d9a, 0x43ba, {0xb2, 0x6f, 0xb8, 0x07, 0xfa, 0x48, 0x60, 0x9c}};
+const IID IID_IGameInput = {0xf2daae4c, 0x4d21, 0x4250, {0x89, 0x53, 0x4f, 0x79, 0x1e, 0x62, 0x79, 0xab}};
-DECLARE_INTERFACE_IID_(IGameInput, IUnknown, "20EFC1C7-5D9A-43BA-B26F-B807FA48609C")
+DECLARE_INTERFACE_IID_(IGameInput, IUnknown, "F2DAAE4C-4D21-4250-8953-4F791E6279AB")
{
IFACEMETHOD_(uint64_t, GetCurrentTimestamp)() PURE;
@@ -1058,28 +1059,10 @@ DECLARE_INTERFACE_IID_(IGameInput, IUnknown, "20EFC1C7-5D9A-43BA-B26F-B807FA4860
IFACEMETHOD(RegisterDeviceCallback)(
_In_opt_ IGameInputDevice* device,
_In_ GameInputKind inputKind,
- _In_ GameInputDeviceStatus statusFilter,
- _In_ GameInputEnumerationKind enumerationKind,
_In_opt_ void* context,
_In_ GameInputDeviceCallback callbackFunc,
_Out_opt_ _Result_zeroonfailure_ GameInputCallbackToken* callbackToken) PURE;
- IFACEMETHOD(RegisterSystemButtonCallback)(
- _In_opt_ IGameInputDevice* device,
- _In_ GameInputSystemButtons buttonFilter,
- _In_opt_ void* context,
- _In_ GameInputSystemButtonCallback callbackFunc,
- _Out_opt_ _Result_zeroonfailure_ GameInputCallbackToken* callbackToken) PURE;
-
- IFACEMETHOD(RegisterKeyboardLayoutCallback)(
- _In_opt_ IGameInputDevice* device,
- _In_opt_ void* context,
- _In_ GameInputKeyboardLayoutCallback callbackFunc,
- _Out_opt_ _Result_zeroonfailure_ GameInputCallbackToken* callbackToken) PURE;
-
- IFACEMETHOD_(void, StopCallback)(
- _In_ GameInputCallbackToken callbackToken) PURE;
-
IFACEMETHOD_(bool, UnregisterCallback)(
_In_ GameInputCallbackToken callbackToken) PURE;
@@ -1094,8 +1077,8 @@ DECLARE_INTERFACE_IID_(IGameInput, IUnknown, "20EFC1C7-5D9A-43BA-B26F-B807FA4860
_In_ LPCWSTR value,
_COM_Outptr_ IGameInputDevice** device) PURE;
- IFACEMETHOD_(void, SetFocusPolicy)(
- _In_ GameInputFocusPolicy policy) PURE;
+ IFACEMETHOD_(void, EnableBackgroundInput)(
+ bool enable) PURE;
IFACEMETHOD(CreateAggregateDevice)(
_In_ GameInputKind inputKind,
@@ -1105,7 +1088,7 @@ DECLARE_INTERFACE_IID_(IGameInput, IUnknown, "20EFC1C7-5D9A-43BA-B26F-B807FA4860
_In_ const APP_LOCAL_DEVICE_ID* deviceId) PURE;
};
-DECLARE_INTERFACE_IID_(IGameInputRawDeviceReport, IUnknown, "05A42D89-2CB6-45A3-874D-E635723587AB")
+DECLARE_INTERFACE_IID_(IGameInputRawDeviceReport, IUnknown, "E35550A9-8507-404B-823C-2035958A6936")
{
IFACEMETHOD_(void, GetDevice)(
_Outptr_ IGameInputDevice** device) PURE;
@@ -1124,7 +1107,7 @@ DECLARE_INTERFACE_IID_(IGameInputRawDeviceReport, IUnknown, "05A42D89-2CB6-45A3-
_In_reads_(bufferSize) const void* buffer) PURE;
};
-DECLARE_INTERFACE_IID_(IGameInputReading, IUnknown, "C81C4CDE-ED1A-4631-A30F-C556A6241A1F")
+DECLARE_INTERFACE_IID_(IGameInputReading, IUnknown, "0DFAA2A2-688B-4A9C-A3A9-0FEB4F90EE12")
{
IFACEMETHOD_(GameInputKind, GetInputKind)() PURE;
@@ -1177,17 +1160,135 @@ DECLARE_INTERFACE_IID_(IGameInputReading, IUnknown, "C81C4CDE-ED1A-4631-A30F-C55
IFACEMETHOD_(bool, GetRawReport)(
_Outptr_result_maybenull_ IGameInputRawDeviceReport** report) PURE;
+
+ IFACEMETHOD_(bool, GetSystemButtonState)(
+ _Out_ GameInputSystemButtons* buttons) PURE;
+
+ IFACEMETHOD_(uint32_t, GetTouchContactCount)(
+ uint32_t surfaceIndex) PURE;
+
+ IFACEMETHOD_(uint32_t, GetTouchSurfaceState)(
+ uint32_t surfaceIndex,
+ uint32_t contactArrayCount,
+ _Out_writes_to_opt_(contactArrayCount, return) GameInputTouchContact* contactArray) PURE;
};
-DECLARE_INTERFACE_IID_(IGameInputDevice, IUnknown, "63E2F38B-A399-4275-8AE7-D4C6E524D12A")
+DECLARE_INTERFACE_IID_(IGameInputDevice, IUnknown, "4420F01D-8918-49D4-B302-DBEAD986105F")
{
- IFACEMETHOD(GetDeviceInfo)(
- _Outptr_ const GameInputDeviceInfo** info) PURE;
+ IFACEMETHOD_(uint16_t, GetVendorId)() PURE;
+
+ IFACEMETHOD_(uint16_t, GetProductId)() PURE;
+
+ IFACEMETHOD_(uint16_t, GetRevisionNumber)() PURE;
+
+ IFACEMETHOD_(void, GetUsage)(
+ _Out_ GameInputUsage* usage) PURE;
+
+ IFACEMETHOD_(void, GetHardwareVersion)(
+ _Out_ GameInputVersion* version) PURE;
+
+ IFACEMETHOD_(void, GetFirmwareVersion)(
+ _Out_ GameInputVersion* version) PURE;
+
+ IFACEMETHOD_(void, GetDeviceId)(
+ _Out_ APP_LOCAL_DEVICE_ID* deviceId) PURE;
+
+ IFACEMETHOD_(void, GetDeviceRootId)(
+ _Out_ APP_LOCAL_DEVICE_ID* deviceRootId) PURE;
+
+ IFACEMETHOD_(GameInputDeviceFamily, GetDeviceFamily)() PURE;
+
+ IFACEMETHOD_(GameInputKind, GetSupportedInput)() PURE;
+
+ IFACEMETHOD_(GameInputRumbleMotors, GetSupportedRumbleMotors)() PURE;
+
+ IFACEMETHOD_(GameInputSystemButtons, GetSupportedSystemButtons)() PURE;
+
+ IFACEMETHOD_(GameInputLightingGroups, GetSupportedLightingGroups)() PURE;
+
+ IFACEMETHOD_(uint32_t, GetSupportedLightingGroupSize)(GameInputLightingGroups group) PURE;
+
+ IFACEMETHOD_(void, GetContainerId)(
+ _Out_ GUID* containerId) PURE;
+
+ IFACEMETHOD_(uint32_t, GetDisplayName)(
+ _In_ uint32_t bufferByteCount,
+ _Out_writes_bytes_opt_(bufferByteCount) char* buffer) PURE;
+
+ IFACEMETHOD_(uint32_t, GetPnpPath)(
+ _In_ uint32_t bufferByteCount,
+ _Out_writes_bytes_opt_(bufferByteCount) char* buffer) PURE;
+
+ IFACEMETHOD_(bool, GetXInputDeviceIndex)(
+ _Out_ uint32_t* index) PURE;
+
+ IFACEMETHOD_(bool, GetKeyboardInfo)(
+ _Out_ GameInputKeyboardInfo* info) PURE;
+
+ IFACEMETHOD_(bool, GetMouseInfo)(
+ _Out_ GameInputMouseInfo* info) PURE;
+
+ IFACEMETHOD_(bool, GetSensorsInfo)(
+ _Out_ GameInputSensorsInfo* info) PURE;
+
+ IFACEMETHOD_(uint32_t, GetControllerAxisCount)() PURE;
+
+ IFACEMETHOD_(uint32_t, GetControllerAxisLabels)(
+ _In_ uint32_t labelArrayCount,
+ _Out_writes_to_opt_(labelArrayCount, return) GameInputLabel* labelArray) PURE;
+
+ IFACEMETHOD_(uint32_t, GetControllerButtonCount)() PURE;
+
+ IFACEMETHOD_(uint32_t, GetControllerButtonLabels)(
+ _In_ uint32_t labelArrayCount,
+ _Out_writes_to_opt_(labelArrayCount, return) GameInputLabel* labelArray) PURE;
+
+ IFACEMETHOD_(uint32_t, GetControllerSwitchCount)() PURE;
+
+ IFACEMETHOD_(uint32_t, GetControllerSwitchInfo)(
+ _In_ uint32_t infoArrayCount,
+ _Out_writes_to_opt_(infoArrayCount, return) GameInputControllerSwitchInfo* infoArray) PURE;
+
+ IFACEMETHOD_(bool, GetArcadeStickInfo)(
+ _Out_ GameInputArcadeStickInfo* info) PURE;
+
+ IFACEMETHOD_(bool, GetFlightStickInfo)(
+ _Out_ GameInputFlightStickInfo* info) PURE;
+
+ IFACEMETHOD_(bool, GetGamepadInfo)(
+ _Out_ GameInputGamepadInfo* info) PURE;
+
+ IFACEMETHOD_(bool, GetRacingWheelInfo)(
+ _Out_ GameInputRacingWheelInfo* info) PURE;
+
+ IFACEMETHOD_(uint32_t, GetForceFeedbackMotorCount)() PURE;
+
+ IFACEMETHOD_(uint32_t, GetForceFeedbackMotorInfo)(
+ _In_ uint32_t infoArrayCount,
+ _Out_writes_to_opt_(infoArrayCount, return) GameInputForceFeedbackMotorInfo* infoArray) PURE;
+
+ IFACEMETHOD_(uint32_t, GetInputReportCount)() PURE;
+
+ IFACEMETHOD_(uint32_t, GetInputReportInfo)(
+
(Patch may be truncated, please check the link at the top of this post.)