From 8cfb4fa1890eb586da85d8dd8d4ef217182a3f1f Mon Sep 17 00:00:00 2001 From: VolsandJezuz Date: Wed, 14 Oct 2015 15:41:48 -0400 Subject: [PATCH] finalized best optimization choices in project file, added notation to changed section of source files, extended/updated documentation, and properly implemented the resource script after changing from VC++2008 Express Edition to Professional --- .gitignore | 2 ++ README | 21 ++++++++++++++------- README.mdown | 18 ++++++++++++------ RInput.vcproj | 6 +++--- rawinput.cpp | 3 +++ rawinput.h | 4 ++++ versioninfo.h | 4 ++-- 7 files changed, 40 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 5b7fde4..863e3a2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ RInput.sln RInput.suo RInput.vcproj.* Release/ +versioninfo.aps .gitconfig +.gitignore diff --git a/README b/README index 515d467..5d3ddbf 100644 --- a/README +++ b/README @@ -1,7 +1,13 @@ -RInput Library v1.33 by Vols and Jezuz +RInput Library v1.34 by Vols and Jezuz -------------------------------------- RInput allows you to override low definition windows mouse input (accurate untill 400cpi) with high definition mouse input (raw input, which is more accurate for high cpi mice). This is certainly useful for older games as those engines only support low definition windows mouse input. +Requirements: +-------------------------------------- +- OS: Windows XP or later +- CPU: Intel Pentium 4 or later; or, AMD Opteron, Athlon 64 or later +- Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022.218 or later (included in RInput release downloads starting with v1.34) + Note: -------------------------------------- This is a fork of RInput Library v1.31 as originally authored by abort. x64 architecture support was never added by him, but here are some notes on what would need to be changed to accomplish this, in case someone is interested: @@ -11,11 +17,12 @@ This is a fork of RInput Library v1.31 as originally authored by abort. x64 arch Building: -------------------------------------- -Compiled with Visual C++ 2008 Express Edition, though you may be able to get it to work with other versions or compilers (available for free @ https://go.microsoft.com/?linkid=7729279); +Compiled with Visual Studio 2008, though you may be able to get it to work with other versions or compilers (Visual C++ 2008 Express Edition is available for free @ https://go.microsoft.com/?linkid=7729279); - Pick Dynamic Library (.dll) as the configuration type - Compile using Multi-Byte Character Set -- Add the Microsoft SDK (I used v6.0A that came with VC++2008) folders as additional Include directory and additional linker library directory +- Add the Microsoft SDK (I used v6.0A that came with VS2008/VC++2008) folders as additional Include directory and additional linker library directory - Compiled with Multi-threaded DLL runtime library for linking +- Set the Entry Point as DllMain - Use x86 architecture for compiling (i.e., RInput does not support for x64 applications) - MS Detours 1.5 header and library were acquired from http://home.comcast.net/~wiccaan/downloads/Detours.rar @@ -32,7 +39,7 @@ Summary of the process by the original author: Credits: -------------------------------------- -BuSheeZy - helping me understand Visual C++ IDE and Git -qsxcv - ideas for how to improve the mouse data handling and information about how mouse input works -about - original author -Dr3am - for the icons +- BuSheeZy - helping me understand Visual C++ IDE and Git +- qsxcv - ideas for how to improve the mouse data handling and information about how mouse input works +- about - original author +- Dr3am - for the icons diff --git a/README.mdown b/README.mdown index a20e15a..12130d0 100644 --- a/README.mdown +++ b/README.mdown @@ -1,6 +1,11 @@ -# RInput Library v1.33 by Vols and Jezuz +# RInput Library v1.34 by Vols and Jezuz RInput allows you to override low definition windows mouse input (accurate untill 400cpi) with high definition mouse input (raw input, which is more accurate for high cpi mice). This is certainly useful for older games as those engines only support low definition windows mouse input. +## Requirements +- OS: Windows XP or later +- CPU: Intel Pentium III or later; or, AMD Opteron, Athlon 64 or later +- Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022.218 or later (included in RInput release downloads starting with v1.34) + ## Note This is a fork of RInput Library v1.31 as originally authored by abort. x64 architecture support was never added by him, but here are some notes on what would need to be changed to accomplish this, in case someone is interested: - The detouring/hooking mechanism needs to support the x64 architectures. This is mainly due to the jumping mechanism for larger pointers. The jumps need to support the whole memory address span over 32-bit @@ -11,8 +16,9 @@ This is a fork of RInput Library v1.31 as originally authored by abort. x64 arch Compiled with Visual C++ 2008 Express Edition, though you may be able to get it to work with other versions or compilers (available for free @ https://go.microsoft.com/?linkid=7729279); - Pick Dynamic Library (.dll) as the configuration type - Compile using Multi-Byte Character Set -- Add the Microsoft SDK (I used v6.0A that came with VC++2008) folders as additional Include directory and additional linker library directory +- Add the Microsoft SDK (I used v6.0A that came with VS2008/VC++2008) folders as additional Include directory and additional linker library directory - Compiled with Multi-threaded DLL runtime library for linking +- Set the Entry Point as DllMain - Use x86 architecture for compiling (i.e., RInput does not support for x64 applications) - MS Detours 1.5 header and library were acquired from http://home.comcast.net/~wiccaan/downloads/Detours.rar @@ -27,7 +33,7 @@ Summary of the process by the original author: 6. The injector gives the user feedback, based on whether the event was raised or not ## Credits: -BuSheeZy - helping me understand Visual C++ IDE and Git -qsxcv - ideas for how to improve the mouse data handling and information about how mouse input works -about - original author -Dr3am - for the icons +- BuSheeZy - helping me understand Visual C++ IDE and Git +- qsxcv - ideas for how to improve the mouse data handling and information about how mouse input works +- about - original author +- Dr3am - for the icons diff --git a/RInput.vcproj b/RInput.vcproj index ef65bef..116c368 100644 --- a/RInput.vcproj +++ b/RInput.vcproj @@ -135,7 +135,7 @@ x; @@ -179,6 +181,7 @@ int __stdcall CRawInput::hGetCursorPos(LPPOINT lpPoint) lpPoint->x = CRawInput::set_x + CRawInput::x; lpPoint->y = CRawInput::set_y + CRawInput::y; + // raw input data accumulator resets have moved here from hSetCursorPos, so raw input data occurring between GetCursorPos/SetCursorPos paired calls is not lost if (CRawInput::s) { CRawInput::x = 0; diff --git a/rawinput.h b/rawinput.h index 79283cc..ec69fa4 100644 --- a/rawinput.h +++ b/rawinput.h @@ -46,8 +46,12 @@ class CRawInput { private: static long x; static long y; + + // mouse data handling is now split between set_x/y (stores the SetCursorPos starting point) and x/y (accumulates the raw input data), which add together as the next GetCursorPos offset static long set_x; static long set_y; + + // toggle so raw input data is not reset when SetCursorPos isn't called after GetCursorPos, which fixes the odd behavior RInput used to have in TF2's backpack and some game menus static bool s; static HWND hwndInput; diff --git a/versioninfo.h b/versioninfo.h index 619dd81..189d679 100644 --- a/versioninfo.h +++ b/versioninfo.h @@ -1,8 +1,8 @@ #ifndef _VERSIONINFO_H_ #define _VERSIONINFO_H_ -#define RINPUTVER "v1.33" -#define RINPUTFVER 1,33 +#define RINPUTVER "v1.34" +#define RINPUTFVER 1,34 #define IDI_ICON 101 #define RINPUTINT "RInput"