Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e8bfc58
initial changes to master repo
VolsandJezuz Oct 5, 2015
b1caecd
forgot rawinput.h, added MS Detours files
VolsandJezuz Oct 5, 2015
caa2270
added project file
VolsandJezuz Oct 5, 2015
cb62606
added .gitignore along with a bunch of project files that are not to …
VolsandJezuz Oct 5, 2015
1ed7fa8
updated .gitconfig and .gitignore
VolsandJezuz Oct 5, 2015
87373a8
actually fixed TF2 backpack this time, made input data handling less …
VolsandJezuz Oct 7, 2015
80da984
removed commented out lines used in testing
VolsandJezuz Oct 7, 2015
61cf810
readded blankspace for code clarity that was accidentally removed
VolsandJezuz Oct 7, 2015
ef8b3ca
removed accidentally added tab blankspace
VolsandJezuz Oct 7, 2015
5cfb654
removed unnecessary whitespace tabs and added trailing newlines to te…
VolsandJezuz Oct 7, 2015
13c60c8
changed unnecessary functions to get initial cursor position to GetCu…
VolsandJezuz Oct 12, 2015
0ed86b4
minor formatting consistency
VolsandJezuz Oct 12, 2015
0bec3f1
discovered a few more compiler optimizations and tweaked other settin…
VolsandJezuz Oct 13, 2015
79fad81
better yet compiler optimizations and compatibility settings
VolsandJezuz Oct 14, 2015
8cfb4fa
finalized best optimization choices in project file, added notation t…
VolsandJezuz Oct 14, 2015
c8f3a95
updated to reflect new requirements due to compilation changes and st…
VolsandJezuz Oct 14, 2015
d7b703b
updated to reflect different IDE version used for compiling
VolsandJezuz Oct 14, 2015
7d0da64
completely fixed mouse data packet handling to be equivalent to m_raw…
VolsandJezuz Oct 19, 2015
566a6df
Updated compiler options for debug configuration
VolsandJezuz Oct 22, 2015
2baa244
Fixed bugs related to in-game console and alt-tabbing
VolsandJezuz Oct 26, 2015
73904f7
Fixed alt-tab bug-fix not working if mouse moving
VolsandJezuz Oct 27, 2015
64411a4
RInput now detects source games and only applies certain bug fixes to…
VolsandJezuz Oct 27, 2015
db8ed1d
First attempt at fixing buy menu/esc menu bug in source games
VolsandJezuz Oct 27, 2015
dcbd4dd
removed buy and escape menu bug fix that dropped some input
VolsandJezuz Nov 3, 2015
626d931
updated versioning and revised parts of the documentation
VolsandJezuz Nov 3, 2015
3221619
minor revisions to header files
VolsandJezuz Nov 4, 2015
4c48a9a
TF2 backpack now 100% fixed; numerous other small changes
VolsandJezuz Nov 5, 2015
140095b
changed two generic WINAPI function calls to ANSI function calls
VolsandJezuz Nov 12, 2015
4609917
Should now work in windowed mode, made TF2 backpack fixes only be app…
VolsandJezuz Nov 13, 2015
55be9c7
made formatting more consistent and expanded READMEs slightly
VolsandJezuz Nov 13, 2015
b502c36
completely fixed all known bugs for CS:GO and TF2
VolsandJezuz Nov 19, 2015
6a899f4
corrected improper threading in DllMain and entryPoint, and deleted u…
VolsandJezuz Nov 20, 2015
e71488e
D3D9 Present hooks now working, to more accurately detect frame renders
VolsandJezuz Nov 20, 2015
19dffe1
changed some coding that had potential for creating very slow memory …
VolsandJezuz Nov 20, 2015
13dbb4f
more rigorous thread closing
VolsandJezuz Nov 20, 2015
f1b1c08
reverted back to only hooking EndScene for CS:GO bug fix as it does t…
VolsandJezuz Nov 21, 2015
05a5acb
reverted some changes to declare functions in main.h that may interac…
VolsandJezuz Nov 21, 2015
735aeb9
readded more reliable D3D Present hooks, made TF2 detectable from oth…
VolsandJezuz Dec 1, 2015
4a1a180
Reverted again back to only hooking EndScene as it was made to be equ…
VolsandJezuz Dec 3, 2015
b7b6511
rearranged includes slightly
VolsandJezuz Dec 3, 2015
b0e917b
very minor code changes
VolsandJezuz Dec 8, 2015
2af1fd0
minor changes to READMEs
VolsandJezuz Dec 8, 2015
ca4fa7f
fixed extremely minor packet deviation with a critical section, impro…
VolsandJezuz Dec 9, 2015
f89d9bc
some minor typo corrections, deletion of unused inline, etc
VolsandJezuz Dec 10, 2015
10f3b60
added threaded unloading function to properly free RInput DLL when D3…
VolsandJezuz Dec 11, 2015
d286dc9
realized that I needed another logic path for DLL_PROCESS_DETACH
VolsandJezuz Dec 11, 2015
2792dd7
redid some of the linkage and optimization options, and removed some …
VolsandJezuz Dec 14, 2015
d715e53
corrected minor oversights
VolsandJezuz Dec 14, 2015
11a1ba9
minor adjustments to optimizations, efficiency, and code style
VolsandJezuz Dec 17, 2015
2a07877
Completely reworked D3D9 hooking to be a midhook, which has alleviate…
VolsandJezuz Dec 18, 2015
ad2d0cc
made D3D9 device declaraction non-local, as local declaraction would …
VolsandJezuz Dec 19, 2015
e7fe249
consolidated header files and added #define's to make program functio…
VolsandJezuz Dec 20, 2015
b0245fa
minor changes to fix an extremely rare chance of dropping a packet
VolsandJezuz Dec 29, 2015
9c6b587
Combined code into a single class (or else what was the point of havi…
VolsandJezuz Jan 5, 2016
c8c0760
Forgot to add new files to commit
VolsandJezuz Jan 5, 2016
d36ccf7
Minor change to make sure critical section is created first and a min…
VolsandJezuz Feb 17, 2016
7a5f25d
Made EndScene hooks work for all versions of Windows from XP to 10 an…
VolsandJezuz Feb 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
RInput.ncb
RInput.sln
RInput.suo
RInput.vcproj.*
Release/
versioninfo.aps
.gitconfig
.gitignore
58 changes: 37 additions & 21 deletions README
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
RInput Library v1.31
----------------------------------
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.
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.

Note:
----------------------------------
Sorry for posting the source this late, I never found the time to find the correct backup, write some comments and add a licensing. The injector still might become open source if I find the time some day.
You can use my previous injector in case you just want to edit the source of the library. Otherwise you can use the instructions below with your own injection stub.
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 but only needed if you get a pop-up error like "MSVCR90.dll is missing" when trying to run RInput)

The code as presented (the last version I released in 2009) supports X86 architecture only. After Valve embedded Raw Input into their games, I did not see the urge of rewriting the projects for the X64 architecture.
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
- The injector for RInput needs to support 64-bit injection and support for finding 64-bit processes
- This library obviously has to get recompiled to 64-bit (might require some changes to Win32 API calls for the RInput HWND)

Building:
----------------------------------
Compile with Visual Studio (or Visual C++ Express);
- Link the library to MS Detours (MS Detours 1.5 was used back then; http://home.comcast.net/~wiccaan/downloads/Detours.rar)
- Make sure you compile the library with a Multi-Byte Character Set

How it works:
----------------------------------
As most of the developers are not into Win32 API these days, I'll just sum up how the process works:
Building
--------------------------------------
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). If you want to start from scratch with your own project file, here's what seem to be the most important compiler and project options:
- 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 VS2008/VC++2008) folders as additional Include directory and additional linker library directory
- Add the Microsoft DirectX SDK (https://www.microsoft.com/en-us/download/confirmation.aspx?id=6812) folders as additional Include directory and additional linker library directory (the x86 folder)
- Compiled with Multi-threaded DLL runtime library for linking
- Set Enable C++ Exceptions to Yes (/EHsc), as several of the included standard C++ headers use exception handlers
- Set Calling Convention __cdecl (/Gd), as it seems to be the only one that performs well and allows D3D9 to be hooked
- Set the Entry Point as DllMain
- Add shlwapi.lib, dxguid.lib, comctl32.lib, and detours.lib to the Additional Dependency list in the Linker options
- Use x86 architecture for compiling (i.e., RInput does not support x64 applications)
- MS Detours 1.5 header and library were acquired from http://home.comcast.net/~wiccaan/downloads/Detours.rar

How it works
--------------------------------------
Summary of the process by the original author:
1. The library gets injected into a process by an injector
2. The injector creates a windows event to communicate with the injected library
3. The injector calls the "entryPoint" function remotely
4. The library initializes the hook and raw mouse input
5. The library raises the event that has been created by the injector
6. The injector gives the user feedback, based on whether the event was raised or not

Credits:
----------------------------------
Dr3am - for the icons
Microsoft - for preventing me from writing my own detour/hooking stub
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
- abort - original author
- Dr3am - for the icons
50 changes: 29 additions & 21 deletions README.mdown
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
# RInput Library v1.31
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.
# 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.

## Note
Sorry for posting the source this late, I never found the time to find the correct backup, write some comments and add a licensing. The injector still might become open source if I find the time some day.
You can use my previous injector in case you just want to edit the source of the library. Otherwise you can use the instructions below with your own injection stub.
## 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 but only needed if you get a pop-up error like "MSVCR90.dll is missing" when trying to run RInput)

The code as presented (the last version I released in 2009) supports X86 architecture only. After Valve embedded Raw Input into their games, I did not see the urge of rewriting the projects for the X64 architecture.
## 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
- The injector for RInput needs to support 64-bit injection and support for finding 64-bit processes
- This library obviously has to get recompiled to 64-bit (might require some changes to Win32 API calls for the RInput HWND)

## Building
Compile with Visual Studio (or Visual C++ Express);
- Link the library to MS Detours (MS Detours 1.5 was used back then; http://home.comcast.net/~wiccaan/downloads/Detours.rar)
- Make sure you compile the library with a Multi-Byte Character Set
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). If you want to start from scratch with your own project file, here's what seem to be the most important compiler and project options:
- 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 VS2008/VC++2008) folders as additional Include directory and additional linker library directory
- Add the Microsoft DirectX SDK (https://www.microsoft.com/en-us/download/confirmation.aspx?id=6812) folders as additional Include directory and additional linker library directory (the x86 folder)
- Compiled with Multi-threaded DLL runtime library for linking
- Set Enable C++ Exceptions to Yes (/EHsc), as several of the included standard C++ headers use exception handlers
- Set Calling Convention __cdecl (/Gd), as it seems to be the only one that performs well and allows D3D9 to be hooked
- Set the Entry Point as DllMain
- Add shlwapi.lib, dxguid.lib, comctl32.lib, and detours.lib to the Additional Dependency list in the Linker options
- Use x86 architecture for compiling (i.e., RInput does not support x64 applications)
- MS Detours 1.5 header and library were acquired from http://home.comcast.net/~wiccaan/downloads/Detours.rar

## How it works
As most of the developers are not into Win32 API these days, I'll just sum up how the process works:

Summary of the process by the original author:
1. The library gets injected into a process by an injector
2. The injector creates a windows event to communicate with the injected library
3. The injector calls the "entryPoint" function remotely
4. The library initializes the hook and raw mouse input
5. The library raises the event that has been created by the injector
6. The injector gives the user feedback, based on whether the event was raised or not

## x64 Support
I never added x64 architecture support, due to old games being 32-bit. Windows XP came out in 2001 and was the first Windows OS to support raw input for input devices. In 2003, 64-bit CPUs were introduced. Building applications for x64 specifically and using the old Win32 cursor API calls, would be contradictory in terms of progressiveness. There is little chance a company would do so (unless quality input data is not important at all). For those that are still interested in implementing this, here is what needs to change at least (perhaps I forgot something):

* 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
* The injector for RInput needs to support 64-bit injection and support for finding 64-bit processes
* This library obviously has to get recompiled to 64-bit (might require some changes to Win32 API calls for the Rinput HWND)

## Credits:
Dr3am: for the icons
Microsoft: for preventing me from writing my own detour/hooking stub
## 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
- abort - original author
- Dr3am - for the icons
Loading