-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Only process input when ST window is active.
- Loading branch information
Showing
6 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
#include <BSGraphics/BSGraphicsRenderer.h> | ||
|
||
struct BSInputDeviceManager; | ||
|
||
void (*BSInputDeviceManager_PollInputDevices)(BSInputDeviceManager*, float) = nullptr; | ||
|
||
void Hook_BSInputDeviceManager_PollInputDevices(BSInputDeviceManager* inputDeviceMgr, float afDelta) | ||
{ | ||
if (!BSGraphics::GetMainWindow()->IsForeground()) | ||
return; | ||
|
||
BSInputDeviceManager_PollInputDevices(inputDeviceMgr, afDelta); | ||
} | ||
|
||
static TiltedPhoques::Initializer s_initInputDeviceManager([]() { | ||
const VersionDbPtr<void> pollInputDevices(68617); | ||
|
||
BSInputDeviceManager_PollInputDevices = | ||
static_cast<decltype(BSInputDeviceManager_PollInputDevices)>(pollInputDevices.GetPtr()); | ||
|
||
TP_HOOK_IMMEDIATE(&BSInputDeviceManager_PollInputDevices, &Hook_BSInputDeviceManager_PollInputDevices); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters