diff --git a/README b/README index 82784ad..b04ed54 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -RInput Library v1.43 by Vols and Jezuz +RInput Library v1.44 by Vols and Jezuz -------------------------------------- RInput is an alternative to in-game raw input, which some users perceive as having input lag or other shortcomings. It also allows for raw input in games which do not have a native raw input implementation. In either case, RInput will only work for x86 (32-bit) games that control aim using the Win32 API functions GetCursorPos and SetCursorPos. diff --git a/README.mdown b/README.mdown index a18953c..30ad282 100644 --- a/README.mdown +++ b/README.mdown @@ -1,4 +1,4 @@ -# RInput Library v1.43 by Vols and Jezuz +# RInput Library v1.44 by Vols and Jezuz RInput is an alternative to in-game raw input, which some users perceive as having input lag or other shortcomings. It also allows for raw input in games which do not have a native raw input implementation. In either case, RInput will only work for x86 (32-bit) games that control aim using the Win32 API functions GetCursorPos and SetCursorPos. ## Requirements diff --git a/RInput.vcproj b/RInput.vcproj index e4dd7b5..678b91d 100644 --- a/RInput.vcproj +++ b/RInput.vcproj @@ -80,7 +80,7 @@ Name="VCLinkerTool" UseUnicodeResponseFiles="false" AdditionalDependencies="detours.lib dxguid.lib shlwapi.lib comctl32.lib" - Version="1.43-debug" + Version="1.44-debug" LinkIncremental="1" AdditionalLibraryDirectories=""C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib";"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86"" EnableUAC="true" @@ -190,7 +190,7 @@ Name="VCLinkerTool" UseUnicodeResponseFiles="false" AdditionalDependencies="detours.lib dxguid.lib shlwapi.lib comctl32.lib" - Version="1.43" + Version="1.44" LinkIncremental="1" AdditionalLibraryDirectories=""C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib";"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86"" GenerateManifest="true" diff --git a/main.cpp b/main.cpp index e92c769..e4196d6 100644 --- a/main.cpp +++ b/main.cpp @@ -108,6 +108,6 @@ void unloadLibrary() void displayError(WCHAR* pwszError) { MessageBoxW(NULL, pwszError, L"Raw Input error!", MB_ICONERROR | MB_OK); - CRawInput::hookLibrary(FALSE); + CRawInput::hookLibrary(false); unloadLibrary(); } \ No newline at end of file diff --git a/rawinput.cpp b/rawinput.cpp index 145b2c1..f620bf3 100644 --- a/rawinput.cpp +++ b/rawinput.cpp @@ -104,6 +104,9 @@ bool CRawInput::initialize(WCHAR* pwszError) else CRawInput::n_sourceEXE = NO_BUG_FIXES; + // Avoid collisions with accumulation of raw input packets + InitializeCriticalSection(&CRawInput::rawMouseData); + if (!CRawInput::initWindow(pwszError)) return false; @@ -291,9 +294,6 @@ bool CRawInput::hookLibrary(bool bInstall) if (!DetourFunctionWithTrampoline((PBYTE)TrmpGetCursorPos, (PBYTE)CRawInput::hGetCursorPos) || !DetourFunctionWithTrampoline((PBYTE)TrmpSetCursorPos, (PBYTE)CRawInput::hSetCursorPos)) return false; - // Avoid collisions with accumulation of raw input packets - InitializeCriticalSection(&CRawInput::rawMouseData); - // Start CS:GO and TF2 D3D9 hooking if (CRawInput::n_sourceEXE <= 2) CRawInput::hD3D9HookThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CRawInput::D3D9HookThread, NULL, 0, 0); @@ -424,9 +424,18 @@ DWORD WINAPI CRawInput::blockInput(LPVOID lpParameter) { BlockInput(TRUE); + long SleepTimer = 0; + // Unblock input after 11 SetCursorPos and/or GetCursorPos calls while (CRawInput::signal <= 12) + { + SleepTimer += 30; + + if (SleepTimer >= 2000) + break; + Sleep(30); + } CRawInput::signal = 0; diff --git a/versioninfo.h b/versioninfo.h index bf1a19f..e31bb38 100644 --- a/versioninfo.h +++ b/versioninfo.h @@ -1,7 +1,7 @@ #ifndef _VERSIONINFO_H_ #define _VERSIONINFO_H_ -#define RINPUTVER "v1.43" -#define RINPUTFVER 1,43 +#define RINPUTVER "v1.44" +#define RINPUTFVER 1,44 #endif