Override low definition windows mouse input with high definition mouse input
C++ C
Switch branches/tags
Nothing to show
Clone or download
Latest commit cf7de7a May 19, 2015
Failed to load latest commit information.
LICENSE Initial commit May 26, 2012
README Initial commit May 26, 2012
README.mdown Fixed credits in readme May 19, 2015
icon.ico Initial commit May 26, 2012
main.cpp Initial commit May 26, 2012
main.h Initial commit May 26, 2012
rawinput.cpp Initial commit May 26, 2012
rawinput.h Initial commit May 26, 2012
versioninfo.h Initial commit May 26, 2012
versioninfo.rc Initial commit May 26, 2012


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.


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.

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.


Compile with Visual Studio (or Visual C++ Express);

How it works

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

  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)


Dr3am: for the icons Microsoft: for preventing me from writing my own detour/hooking stub