-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdllmain.cpp
More file actions
executable file
·721 lines (592 loc) · 18.7 KB
/
Copy pathdllmain.cpp
File metadata and controls
executable file
·721 lines (592 loc) · 18.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
// dllmain.cpp : Defines the entry point for the DLL application.
#define NOMINMAX // Prevents windows.h from breaking min/max
#include "pch.h"
#include "gameinput.h"
#include "aixlog.hpp"
#include "xinput.h"
#include <algorithm>
#define LOG_FUNCTION_CALL do { \
static bool emitted = false; \
if (!emitted) \
{ \
LOG(AixLog::Severity::info) << "function invoked" << std::endl; \
emitted = true; \
} \
} while (0)
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{
auto sink_cout = std::make_shared<AixLog::SinkCout>(AixLog::Severity::trace);
auto sink_file = std::make_shared<AixLog::SinkFile>(AixLog::Severity::trace, "gameinput.log");
AixLog::Log::init({ sink_cout, sink_file });
LOG_FUNCTION_CALL;
}
return TRUE;
}
// https://github.com/SpecialKO/SpecialK/blob/245e0c06b4cc2785972a35adbe0b4d1552a83b5b/src/input/game_input.cpp#L1859
// GNU General Public License 3
static void ConvertXInputToGameInput(const XINPUT_STATE& xinputState, GameInputGamepadState* state)
{
const XINPUT_GAMEPAD& xgamepad = xinputState.Gamepad;
state->buttons = GameInputGamepadNone;
state->leftThumbstickX =
static_cast <float> (static_cast <double> (xgamepad.sThumbLX) / 32767.0);
state->leftThumbstickY =
static_cast <float> (static_cast <double> (xgamepad.sThumbLY) / 32767.0);
state->rightThumbstickX =
static_cast <float> (static_cast <double> (xgamepad.sThumbRX) / 32767.0);
state->rightThumbstickY =
static_cast <float> (static_cast <double> (xgamepad.sThumbRY) / 32767.0);
state->leftTrigger =
static_cast <float> (static_cast <double> (xgamepad.bLeftTrigger) / 255.0);
state->rightTrigger =
static_cast <float> (static_cast <double> (xgamepad.bRightTrigger) / 255.0);
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_A) != 0 ? GameInputGamepadA : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_B) != 0 ? GameInputGamepadB : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_X) != 0 ? GameInputGamepadX : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_Y) != 0 ? GameInputGamepadY : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_START) != 0 ? GameInputGamepadMenu : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_BACK) != 0 ? GameInputGamepadView : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) != 0 ? GameInputGamepadDPadUp : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN) != 0 ? GameInputGamepadDPadDown : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) != 0 ? GameInputGamepadDPadLeft : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) != 0 ? GameInputGamepadDPadRight : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER) != 0 ? GameInputGamepadLeftShoulder : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER) != 0 ? GameInputGamepadRightShoulder : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) != 0 ? GameInputGamepadLeftThumbstick : GameInputGamepadNone;
state->buttons |= (xgamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) != 0 ? GameInputGamepadRightThumbstick : GameInputGamepadNone;
}
class GameInputDeviceState {
public:
int xinputSlot = -1;
};
class GameInputDevice : public IGameInputDevice {
private:
GameInputDeviceState* _deviceState;
public:
explicit GameInputDevice(GameInputDeviceState* deviceState) : _deviceState(deviceState)
{
LOG_FUNCTION_CALL;
}
HRESULT QueryInterface(const IID& riid, void** ppvObj) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
ULONG AddRef() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
ULONG Release() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
const GameInputDeviceInfo* GetDeviceInfo() noexcept override
{
LOG_FUNCTION_CALL;
static const GameInputDeviceInfo dev_info = [] {
GameInputDeviceInfo info = {};
info.infoSize = sizeof(GameInputDeviceInfo);
info.controllerAxisCount = 6;
info.controllerButtonCount = 14;
info.deviceId = { 1 };
info.deviceRootId = { 1 };
info.capabilities = GameInputDeviceCapabilityWireless;
info.vendorId = 0x45e;
info.productId = 0x28e;
info.deviceFamily = GameInputFamilyXboxOne;
info.usage.id = 5;
info.usage.page = 1;
info.interfaceNumber = 0;
info.hardwareVersion.major = 1;
info.hardwareVersion.minor = 0;
info.firmwareVersion.major = 0;
info.firmwareVersion.minor = 0;
info.supportedInput =
GameInputKindControllerAxis |
GameInputKindControllerButton |
GameInputKindGamepad |
GameInputKindUiNavigation;
info.supportedRumbleMotors =
GameInputRumbleLowFrequency |
GameInputRumbleHighFrequency |
GameInputRumbleLeftTrigger |
GameInputRumbleRightTrigger;
static const GameInputGamepadInfo gamepadInfo = {
GameInputLabelXboxStart, GameInputLabelXboxBack,
GameInputLabelXboxA, GameInputLabelXboxB,
GameInputLabelXboxX, GameInputLabelXboxY,
GameInputLabelXboxDPadUp, GameInputLabelXboxDPadDown,
GameInputLabelXboxDPadLeft, GameInputLabelXboxDPadRight,
GameInputLabelXboxLeftShoulder, GameInputLabelXboxRightShoulder,
GameInputLabelXboxLeftStickButton, GameInputLabelXboxRightStickButton
};
static const GameInputUiNavigationInfo uiNavigationInfo = {
GameInputLabelXboxStart, GameInputLabelXboxBack,
GameInputLabelXboxA, GameInputLabelXboxB,
GameInputLabelXboxDPadUp, GameInputLabelXboxDPadDown,
GameInputLabelXboxDPadLeft, GameInputLabelXboxDPadRight,
GameInputLabelXboxX, GameInputLabelXboxY,
GameInputLabelXboxLeftStickButton, GameInputLabelXboxRightStickButton,
GameInputLabelXboxLeftTrigger, GameInputLabelXboxRightTrigger,
GameInputLabelXboxLeftShoulder, GameInputLabelXboxRightShoulder,
GameInputLabelUnknown, GameInputLabelUnknown,
GameInputLabelUnknown, GameInputLabelUnknown,
GameInputLabelUnknown
};
info.gamepadInfo = &gamepadInfo;
info.uiNavigationInfo = &uiNavigationInfo;
return info;
}();
return &dev_info;
}
GameInputDeviceStatus GetDeviceStatus() noexcept override
{
LOG_FUNCTION_CALL;
return GameInputDeviceConnected;
}
void GetBatteryState(GameInputBatteryState* state) noexcept override
{
LOG_FUNCTION_CALL;
}
HRESULT CreateForceFeedbackEffect(uint32_t motorIndex, const GameInputForceFeedbackParams* params, IGameInputForceFeedbackEffect** effect) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
bool IsForceFeedbackMotorPoweredOn(uint32_t motorIndex) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
void SetForceFeedbackMotorGain(uint32_t motorIndex, float masterGain) noexcept override
{
LOG_FUNCTION_CALL;
}
HRESULT SetHapticMotorState(uint32_t motorIndex, const GameInputHapticFeedbackParams* params) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
void SetRumbleState(const GameInputRumbleParams* params) noexcept override
{
LOG_FUNCTION_CALL;
XINPUT_VIBRATION vibration = {};
if (params != nullptr)
{
float leftTotal = params->lowFrequency + params->leftTrigger;
float rightTotal = params->highFrequency + params->rightTrigger;
auto clamp = [](float v) { return v < 0.0f ? 0.0f : (v > 1.0f ? 1.0f : v); };
leftTotal = clamp(leftTotal);
rightTotal = clamp(rightTotal);
vibration.wLeftMotorSpeed = static_cast<WORD>(leftTotal * 65535.0f);
vibration.wRightMotorSpeed = static_cast<WORD>(rightTotal * 65535.0f);
}
auto xinputSlot = _deviceState->xinputSlot;
if (xinputSlot != -1)
{
auto result = XInputSetState(xinputSlot, &vibration);
if (result != ERROR_SUCCESS)
{
LOG(AixLog::Severity::error) << "xinput set state error: " << result << " slot: " << xinputSlot << std::endl;
}
}
}
void SetInputSynchronizationState(bool enabled) noexcept override
{
LOG_FUNCTION_CALL;
}
void SendInputSynchronizationHint() noexcept override
{
LOG_FUNCTION_CALL;
}
void PowerOff() noexcept override
{
LOG_FUNCTION_CALL;
}
HRESULT CreateRawDeviceReport(uint32_t reportId, GameInputRawDeviceReportKind reportKind, IGameInputRawDeviceReport** report) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT GetRawDeviceFeature(uint32_t reportId, IGameInputRawDeviceReport** report) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT SetRawDeviceFeature(IGameInputRawDeviceReport* report) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT SendRawDeviceOutput(IGameInputRawDeviceReport* report) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT SendRawDeviceOutputWithResponse(IGameInputRawDeviceReport* requestReport, IGameInputRawDeviceReport** responseReport) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT ExecuteRawDeviceIoControl(uint32_t controlCode, size_t inputBufferSize, const void* inputBuffer, size_t outputBufferSize, void* outputBuffer, size_t* outputSize) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
bool AcquireExclusiveRawDeviceAccess(uint64_t timeoutInMicroseconds) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
void ReleaseExclusiveRawDeviceAccess() noexcept override
{
LOG_FUNCTION_CALL;
}
};
class GameInputReading : public IGameInputReading {
private:
LARGE_INTEGER _timestamp = {};
XINPUT_STATE _lastXinputState = {};
GameInputDeviceState* _deviceState;
bool _logAllXinputErrorsOnce = true;
public:
explicit GameInputReading(GameInputDeviceState* deviceState) : _deviceState(deviceState)
{
LOG_FUNCTION_CALL;
}
HRESULT QueryInterface(const IID& riid, void** ppvObj) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
ULONG AddRef() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
ULONG Release() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
GameInputKind GetInputKind() noexcept override
{
LOG_FUNCTION_CALL;
return GameInputKindGamepad;
}
uint64_t GetSequenceNumber(GameInputKind inputKind) noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint64_t GetTimestamp() noexcept override
{
LOG_FUNCTION_CALL;
return _timestamp.QuadPart;
}
void GetDevice(IGameInputDevice** device) noexcept override
{
LOG_FUNCTION_CALL;
}
bool GetRawReport(IGameInputRawDeviceReport** report) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
uint32_t GetControllerAxisCount() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint32_t GetControllerAxisState(uint32_t stateArrayCount, float* stateArray) noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint32_t GetControllerButtonCount() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint32_t GetControllerButtonState(uint32_t stateArrayCount, bool* stateArray) noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint32_t GetControllerSwitchCount() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint32_t GetControllerSwitchState(uint32_t stateArrayCount, GameInputSwitchPosition* stateArray) noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint32_t GetKeyCount() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint32_t GetKeyState(uint32_t stateArrayCount, GameInputKeyState* stateArray) noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
bool GetMouseState(GameInputMouseState* state) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
uint32_t GetTouchCount() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint32_t GetTouchState(uint32_t stateArrayCount, GameInputTouchState* stateArray) noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
bool GetMotionState(GameInputMotionState* state) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
bool GetArcadeStickState(GameInputArcadeStickState* state) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
bool GetFlightStickState(GameInputFlightStickState* state) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
bool GetGamepadState(GameInputGamepadState* state) noexcept override
{
LOG_FUNCTION_CALL;
XINPUT_STATE xinputState;
bool xinputSuccess = false;
ZeroMemory(&xinputState, sizeof(XINPUT_STATE));
ZeroMemory(state, sizeof(GameInputGamepadState));
auto xinputSlot = _deviceState->xinputSlot;
if (xinputSlot == -1)
{
for (DWORD i = 0; i < XUSER_MAX_COUNT; i++)
{
int result = XInputGetState(i, &xinputState);
if (result == ERROR_SUCCESS)
{
LOG(AixLog::Severity::info) << "using xinput slot: " << i << std::endl;
xinputSuccess = true;
_deviceState->xinputSlot = i;
break;
}
else
{
if (_logAllXinputErrorsOnce)
{
LOG(AixLog::Severity::error) << "xinput error: " << result << " slot: " << i << std::endl;
}
}
}
_logAllXinputErrorsOnce = false;
}
else
{
int result = XInputGetState(xinputSlot, &xinputState);
if (result == ERROR_SUCCESS)
{
xinputSuccess = true;
}
else
{
LOG(AixLog::Severity::error) << "xinput error: " << result << " slot: " << xinputSlot << std::endl;
_logAllXinputErrorsOnce = true;
}
}
if (xinputSuccess)
{
if (std::exchange(_lastXinputState.dwPacketNumber, xinputState.dwPacketNumber) < xinputState.dwPacketNumber)
{
QueryPerformanceCounter(&_timestamp);
}
ConvertXInputToGameInput(xinputState, state);
}
else
{
_timestamp = {};
_deviceState->xinputSlot = -1;
_lastXinputState.dwPacketNumber = 0;
}
return xinputSuccess;
}
bool GetRacingWheelState(GameInputRacingWheelState* state) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
bool GetUiNavigationState(GameInputUiNavigationState* state) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
};
class GameInput : public IGameInput {
private:
GameInputDeviceState _deviceState{};
GameInputDevice _device{ &_deviceState };
GameInputReading _reading{ &_deviceState };
UINT64 _lastGamepadReading = 0;
public:
HRESULT QueryInterface(const IID& riid, void** ppvObj) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
ULONG AddRef() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
ULONG Release() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
uint64_t GetCurrentTimestamp() noexcept override
{
LOG_FUNCTION_CALL;
return 0;
}
HRESULT GetCurrentReading(GameInputKind inputKind, IGameInputDevice* device, IGameInputReading** reading) noexcept override
{
LOG_FUNCTION_CALL;
if (device == &_device)
{
*reading = &_reading;
return S_OK;
}
return E_NOTIMPL;
}
HRESULT GetNextReading(IGameInputReading* referenceReading, GameInputKind inputKind, IGameInputDevice* device, IGameInputReading** reading) noexcept override
{
LOG_FUNCTION_CALL;
if (device == &_device)
{
GameInputGamepadState gamepad_state = {};
if (_reading.GetGamepadState(&gamepad_state))
{
if (std::exchange(_lastGamepadReading, _reading.GetTimestamp()) < _reading.GetTimestamp())
{
*reading = &_reading;
return S_OK;
}
}
return GAMEINPUT_E_READING_NOT_FOUND;
}
return E_NOTIMPL;
}
HRESULT GetPreviousReading(IGameInputReading* referenceReading, GameInputKind inputKind, IGameInputDevice* device, IGameInputReading** reading) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT GetTemporalReading(uint64_t timestamp, IGameInputDevice* device, IGameInputReading** reading) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT RegisterReadingCallback(IGameInputDevice* device, GameInputKind inputKind, float analogThreshold, void* context, GameInputReadingCallback callbackFunc, GameInputCallbackToken* callbackToken) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT RegisterDeviceCallback(IGameInputDevice* device, GameInputKind inputKind, GameInputDeviceStatus statusFilter, GameInputEnumerationKind enumerationKind, void* context, GameInputDeviceCallback callbackFunc, GameInputCallbackToken* callbackToken) noexcept override
{
LOG_FUNCTION_CALL;
if ((inputKind & GameInputKindGamepad) != 0 && (statusFilter & GameInputDeviceConnected) != 0)
{
LOG(AixLog::Severity::info) << "calling device callback with our fake device" << std::endl;
LARGE_INTEGER timestamp;
QueryPerformanceCounter(×tamp);
callbackFunc(callbackToken != nullptr ? *callbackToken : 0, context, &_device, timestamp.QuadPart, GameInputDeviceConnected, GameInputDeviceConnected);
return S_OK;
}
LOG(AixLog::Severity::info) << "not returning fake device, inputKind: " << inputKind << " statusFilter: " << statusFilter << std::endl;
return E_NOTIMPL;
}
HRESULT RegisterGuideButtonCallback(IGameInputDevice* device, void* context, GameInputGuideButtonCallback callbackFunc, GameInputCallbackToken* callbackToken) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT RegisterKeyboardLayoutCallback(IGameInputDevice* device, void* context, GameInputKeyboardLayoutCallback callbackFunc, GameInputCallbackToken* callbackToken) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
void StopCallback(GameInputCallbackToken callbackToken) noexcept override
{
LOG_FUNCTION_CALL;
}
bool UnregisterCallback(GameInputCallbackToken callbackToken, uint64_t timeoutInMicroseconds) noexcept override
{
LOG_FUNCTION_CALL;
return false;
}
HRESULT CreateDispatcher(IGameInputDispatcher** dispatcher) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT CreateAggregateDevice(GameInputKind inputKind, IGameInputDevice** device) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT FindDeviceFromId(const APP_LOCAL_DEVICE_ID* value, IGameInputDevice** device) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT FindDeviceFromObject(IUnknown* value, IGameInputDevice** device) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT FindDeviceFromPlatformHandle(HANDLE value, IGameInputDevice** device) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT FindDeviceFromPlatformString(LPCWSTR value, IGameInputDevice** device) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
HRESULT EnableOemDeviceSupport(uint16_t vendorId, uint16_t productId, uint8_t interfaceNumber, uint8_t collectionNumber) noexcept override
{
LOG_FUNCTION_CALL;
return E_NOTIMPL;
}
void SetFocusPolicy(GameInputFocusPolicy policy) noexcept override
{
LOG_FUNCTION_CALL;
}
};
extern "C" __declspec(dllexport) HRESULT __stdcall GameInputCreate(_COM_Outptr_ IGameInput** gameInput)
{
LOG_FUNCTION_CALL;
static GameInput gameInputSingleton{};
*gameInput = &gameInputSingleton;
return S_OK;
}