├── .gitattributes ├── .gitignore ├── DInputWrapper.sln └── DInputWrapper ├── DInputWrapper.cpp ├── DInputWrapper.vcxproj ├── DInputWrapper.vcxproj.filters ├── HOOKDirectInput.cpp ├── HOOKDirectInput.h ├── HOOKDirectInputDevice.cpp ├── HOOKDirectInputDevice.h ├── LICENSE.txt ├── ReadMe.txt ├── dinput.h ├── dinput8.def ├── dllmain.cpp ├── sample_config_files ├── 16x9 sensitivity.txt ├── 4x3 sensitivity.txt ├── eyefinity 3x 16x9 sensitivity.txt └── ultrawide sensitivity.txt ├── stdafx.cpp ├── stdafx.h └── targetver.h /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | [Xx]64/ 19 | [Xx]86/ 20 | [Bb]uild/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | 143 | # TODO: Un-comment the next line if you do not want to checkin 144 | # your web deploy settings because they may include unencrypted 145 | # passwords 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nupkg 151 | # The packages folder can be ignored because of Package Restore 152 | **/packages/* 153 | # except build/, which is used as an MSBuild target. 154 | !**/packages/build/ 155 | # Uncomment if necessary however generally it will be regenerated when needed 156 | #!**/packages/repositories.config 157 | # NuGet v3's project.json files produces more ignoreable files 158 | *.nuget.props 159 | *.nuget.targets 160 | 161 | # Microsoft Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Microsoft Azure Emulator 166 | ecf/ 167 | rcf/ 168 | 169 | # Microsoft Azure ApplicationInsights config file 170 | ApplicationInsights.config 171 | 172 | # Windows Store app package directory 173 | AppPackages/ 174 | BundleArtifacts/ 175 | 176 | # Visual Studio cache files 177 | # files ending in .cache can be ignored 178 | *.[Cc]ache 179 | # but keep track of directories ending in .cache 180 | !*.[Cc]ache/ 181 | 182 | # Others 183 | ClientBin/ 184 | [Ss]tyle[Cc]op.* 185 | ~$* 186 | *~ 187 | *.dbmdl 188 | *.dbproj.schemaview 189 | *.pfx 190 | *.publishsettings 191 | node_modules/ 192 | orleans.codegen.cs 193 | 194 | # RIA/Silverlight projects 195 | Generated_Code/ 196 | 197 | # Backup & report files from converting an old project file 198 | # to a newer Visual Studio version. Backup files are not needed, 199 | # because we have git ;-) 200 | _UpgradeReport_Files/ 201 | Backup*/ 202 | UpgradeLog*.XML 203 | UpgradeLog*.htm 204 | 205 | # SQL Server files 206 | *.mdf 207 | *.ldf 208 | 209 | # Business Intelligence projects 210 | *.rdl.data 211 | *.bim.layout 212 | *.bim_*.settings 213 | 214 | # Microsoft Fakes 215 | FakesAssemblies/ 216 | 217 | # GhostDoc plugin setting file 218 | *.GhostDoc.xml 219 | 220 | # Node.js Tools for Visual Studio 221 | .ntvs_analysis.dat 222 | 223 | # Visual Studio 6 build log 224 | *.plg 225 | 226 | # Visual Studio 6 workspace options file 227 | *.opt 228 | 229 | # Visual Studio LightSwitch build output 230 | **/*.HTMLClient/GeneratedArtifacts 231 | **/*.DesktopClient/GeneratedArtifacts 232 | **/*.DesktopClient/ModelManifest.xml 233 | **/*.Server/GeneratedArtifacts 234 | **/*.Server/ModelManifest.xml 235 | _Pvt_Extensions 236 | 237 | # LightSwitch generated files 238 | GeneratedArtifacts/ 239 | ModelManifest.xml 240 | 241 | # Paket dependency manager 242 | .paket/paket.exe 243 | 244 | # FAKE - F# Make 245 | .fake/ -------------------------------------------------------------------------------- /DInputWrapper.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DInputWrapper", "DInputWrapper\DInputWrapper.vcxproj", "{B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}.Debug|x64.ActiveCfg = Debug|x64 17 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}.Debug|x64.Build.0 = Debug|x64 18 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}.Debug|x86.ActiveCfg = Debug|Win32 19 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}.Debug|x86.Build.0 = Debug|Win32 20 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}.Release|x64.ActiveCfg = Release|x64 21 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}.Release|x64.Build.0 = Release|x64 22 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}.Release|x86.ActiveCfg = Release|Win32 23 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /DInputWrapper/DInputWrapper.cpp: -------------------------------------------------------------------------------- 1 | // DInputWrapper.cpp : Defines the exported functions for the DLL application. 2 | // 3 | 4 | #include 5 | #include "stdafx.h" 6 | 7 | #include "HOOKDirectInput.h" 8 | 9 | typedef HRESULT(WINAPI *dICreate_t)(HINSTANCE, DWORD, REFIID, LPVOID, LPUNKNOWN); 10 | typedef HRESULT(*cDevice_t)(REFGUID rguid, LPDIRECTINPUTDEVICE * lplpDirectInputDevice, LPUNKNOWN pUnkOuter); 11 | 12 | dICreate_t old_DirectInput8Create = NULL; 13 | 14 | int init_wrapper() 15 | { 16 | WCHAR dllpath[320]; 17 | if (!GetSystemDirectory(dllpath, sizeof(dllpath))) 18 | return 0; 19 | 20 | wcsncat_s(dllpath, 320, L"\\dinput8.dll", _TRUNCATE); 21 | 22 | HMODULE mod = LoadLibrary(dllpath); 23 | if (!mod) 24 | return 0; 25 | 26 | old_DirectInput8Create = (dICreate_t)GetProcAddress(mod, "DirectInput8Create"); 27 | return (old_DirectInput8Create) ? 1 : 0; 28 | } 29 | 30 | HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter) { 31 | if (!old_DirectInput8Create) 32 | if (!init_wrapper()) 33 | return E_FAIL; 34 | 35 | HRESULT res = old_DirectInput8Create(hinst, dwVersion, riidltf, ppvOut, punkOuter); 36 | if (FAILED(res)) 37 | return res; 38 | 39 | IDirectInput8 *dinput = new HOOKDirectInput((IDirectInput8*)*ppvOut); 40 | *ppvOut = dinput; 41 | 42 | return res; 43 | } -------------------------------------------------------------------------------- /DInputWrapper/DInputWrapper.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {B9DF64FD-C992-47E0-981E-63E6C1D6A5D4} 23 | Win32Proj 24 | DInputWrapper 25 | 8.1 26 | 27 | 28 | 29 | DynamicLibrary 30 | true 31 | v140 32 | Unicode 33 | 34 | 35 | DynamicLibrary 36 | false 37 | v140 38 | true 39 | Unicode 40 | 41 | 42 | DynamicLibrary 43 | true 44 | v140 45 | Unicode 46 | 47 | 48 | DynamicLibrary 49 | false 50 | v140 51 | true 52 | Unicode 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | true 74 | dinput8 75 | 76 | 77 | true 78 | dinput8 79 | 80 | 81 | false 82 | dinput8 83 | 84 | 85 | false 86 | dinput8 87 | 88 | 89 | 90 | Use 91 | Level3 92 | Disabled 93 | WIN32;_DEBUG;_WINDOWS;_USRDLL;DINPUTWRAPPER_EXPORTS;%(PreprocessorDefinitions) 94 | true 95 | 96 | 97 | Windows 98 | true 99 | dinput8.def 100 | dxguid.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 101 | 102 | 103 | 104 | 105 | Use 106 | Level3 107 | Disabled 108 | _DEBUG;_WINDOWS;_USRDLL;DINPUTWRAPPER_EXPORTS;%(PreprocessorDefinitions) 109 | true 110 | 111 | 112 | Windows 113 | true 114 | dinput8.def 115 | 116 | 117 | 118 | 119 | Level3 120 | Use 121 | MaxSpeed 122 | true 123 | true 124 | WIN32;NDEBUG;_WINDOWS;_USRDLL;DINPUTWRAPPER_EXPORTS;%(PreprocessorDefinitions) 125 | true 126 | 127 | 128 | Windows 129 | true 130 | true 131 | true 132 | dinput8.def 133 | dxguid.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) 134 | 135 | 136 | 137 | 138 | Level3 139 | Use 140 | MaxSpeed 141 | true 142 | true 143 | NDEBUG;_WINDOWS;_USRDLL;DINPUTWRAPPER_EXPORTS;%(PreprocessorDefinitions) 144 | true 145 | 146 | 147 | Windows 148 | true 149 | true 150 | true 151 | dinput8.def 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | false 169 | 170 | 171 | false 172 | 173 | 174 | false 175 | 176 | 177 | false 178 | 179 | 180 | 181 | 182 | 183 | 184 | Create 185 | Create 186 | Create 187 | Create 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | -------------------------------------------------------------------------------- /DInputWrapper/DInputWrapper.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Header Files 24 | 25 | 26 | Header Files 27 | 28 | 29 | Header Files 30 | 31 | 32 | Header Files 33 | 34 | 35 | Header Files 36 | 37 | 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | Source Files 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | 56 | 57 | Source Files 58 | 59 | 60 | -------------------------------------------------------------------------------- /DInputWrapper/HOOKDirectInput.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdafx.h" 3 | 4 | #include "dinput.h" 5 | #include "HOOKDirectInput.h" 6 | #include "HOOKDirectInputDevice.h" 7 | 8 | HRESULT WINAPI HOOKDirectInput::QueryInterface(REFIID iid, void ** ppvObject) 9 | { 10 | return actual->QueryInterface(iid, ppvObject); 11 | } 12 | 13 | ULONG WINAPI HOOKDirectInput::AddRef(void) 14 | { 15 | return actual->AddRef(); 16 | } 17 | 18 | ULONG WINAPI HOOKDirectInput::Release(void) 19 | { 20 | return actual->Release(); 21 | } 22 | 23 | HRESULT WINAPI HOOKDirectInput::ConfigureDevices(LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMS lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) 24 | { 25 | return actual->ConfigureDevices(lpdiCallback, lpdiCDParams, dwFlags, pvRefData); 26 | } 27 | 28 | HRESULT WINAPI HOOKDirectInput::CreateDevice(REFGUID rguid, LPDIRECTINPUTDEVICE8 *lpDirectInputDevice, LPUNKNOWN pUnkOuter) 29 | { 30 | HRESULT res = actual->CreateDevice(rguid, lpDirectInputDevice, pUnkOuter); 31 | if (rguid != GUID_SysMouse || FAILED(res)) 32 | return res; 33 | 34 | IDirectInputDevice8 *dev = new HOOKDirectInputDevice(*lpDirectInputDevice); 35 | *lpDirectInputDevice = dev; 36 | 37 | return res; 38 | } 39 | 40 | HRESULT WINAPI HOOKDirectInput::EnumDevices(DWORD dwDevType, LPDIENUMDEVICESCALLBACK lpCallback, LPVOID pvRef, DWORD dwFlags) 41 | { 42 | return actual->EnumDevices(dwDevType, lpCallback, pvRef, dwFlags); 43 | } 44 | 45 | HRESULT WINAPI HOOKDirectInput::EnumDevicesBySemantics(LPCTSTR ptszUserName, LPDIACTIONFORMAT lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCB lpCallback, LPVOID pvRef, DWORD dwFlags) 46 | { 47 | return actual->EnumDevicesBySemantics(ptszUserName, lpdiActionFormat, lpCallback, pvRef, dwFlags); 48 | } 49 | 50 | HRESULT WINAPI HOOKDirectInput::FindDevice(REFGUID rguidClass, LPCTSTR ptszName, LPGUID pguidInstance) 51 | { 52 | return actual->FindDevice(rguidClass, ptszName, pguidInstance); 53 | } 54 | 55 | HRESULT WINAPI HOOKDirectInput::GetDeviceStatus(REFGUID rguidInstance) 56 | { 57 | return actual->GetDeviceStatus(rguidInstance); 58 | } 59 | 60 | HRESULT WINAPI HOOKDirectInput::Initialize(HINSTANCE hinst, DWORD dwVersion) 61 | { 62 | return actual->Initialize(hinst, dwVersion); 63 | } 64 | 65 | HRESULT WINAPI HOOKDirectInput::RunControlPanel(HWND hwndOwner, DWORD dwFlags) 66 | { 67 | return actual->RunControlPanel(hwndOwner, dwFlags); 68 | } 69 | 70 | HOOKDirectInput::HOOKDirectInput(IDirectInput8 *actualDirectInput) 71 | { 72 | actual = actualDirectInput; 73 | } 74 | 75 | HOOKDirectInput::~HOOKDirectInput() 76 | { 77 | //???? 78 | } -------------------------------------------------------------------------------- /DInputWrapper/HOOKDirectInput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class HOOKDirectInput : public IDirectInput8 4 | { 5 | private: 6 | IDirectInput8 *actual; 7 | 8 | public: 9 | HRESULT WINAPI QueryInterface(REFIID iid, void ** ppvObject); 10 | ULONG WINAPI AddRef(void); 11 | ULONG WINAPI Release(void); 12 | HRESULT WINAPI ConfigureDevices(LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMS lpdiCDParams, DWORD dwFlags, LPVOID pvRefData); 13 | HRESULT WINAPI CreateDevice(REFGUID rguid, LPDIRECTINPUTDEVICE8 *lpDirectInputDevice, LPUNKNOWN pUnkOuter); 14 | HRESULT WINAPI EnumDevices(DWORD dwDevType, LPDIENUMDEVICESCALLBACK lpCallback, LPVOID pvRef, DWORD dwFlags); 15 | HRESULT WINAPI EnumDevicesBySemantics(LPCTSTR ptszUserName, LPDIACTIONFORMAT lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCB lpCallback, LPVOID pvRef, DWORD dwFlags); 16 | HRESULT WINAPI FindDevice(REFGUID rguidClass, LPCTSTR ptszName, LPGUID pguidInstance); 17 | HRESULT WINAPI GetDeviceStatus(REFGUID rguidInstance); 18 | HRESULT WINAPI Initialize(HINSTANCE hinst, DWORD dwVersion); 19 | HRESULT WINAPI RunControlPanel(HWND hwndOwner, DWORD dwFlags); 20 | 21 | HOOKDirectInput(IDirectInput8 *actualDirectInput); 22 | virtual ~HOOKDirectInput(void); 23 | }; -------------------------------------------------------------------------------- /DInputWrapper/HOOKDirectInputDevice.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdafx.h" 3 | 4 | #include 5 | 6 | #include "dinput.h" 7 | #include "HOOKDirectInputDevice.h" 8 | 9 | static int isConfigLoaded = 0; 10 | static float aspect = 1.77777777777777; 11 | 12 | HRESULT WINAPI HOOKDirectInputDevice::QueryInterface(REFIID iid, void ** ppvObject) 13 | { 14 | return actualDirectInputDevice->QueryInterface(iid, ppvObject); 15 | } 16 | 17 | ULONG WINAPI HOOKDirectInputDevice::AddRef(void) 18 | { 19 | return actualDirectInputDevice->AddRef(); 20 | } 21 | 22 | ULONG WINAPI HOOKDirectInputDevice::Release(void) 23 | { 24 | return actualDirectInputDevice->Release(); 25 | } 26 | 27 | HRESULT WINAPI HOOKDirectInputDevice::Acquire() 28 | { 29 | return actualDirectInputDevice->Acquire(); 30 | } 31 | 32 | HRESULT WINAPI HOOKDirectInputDevice::BuildActionMap(LPDIACTIONFORMAT lpdiaf, LPCTSTR lpszUserName, DWORD dwFlags) 33 | { 34 | return actualDirectInputDevice->BuildActionMap(lpdiaf, lpszUserName, dwFlags); 35 | } 36 | 37 | HRESULT WINAPI HOOKDirectInputDevice::CreateEffect(REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) 38 | { 39 | return actualDirectInputDevice->CreateEffect(rguid, lpeff, ppdeff, punkOuter); 40 | } 41 | 42 | HRESULT WINAPI HOOKDirectInputDevice::EnumCreatedEffectObjects(LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) 43 | { 44 | return actualDirectInputDevice->EnumCreatedEffectObjects(lpCallback, pvRef, fl); 45 | } 46 | 47 | HRESULT WINAPI HOOKDirectInputDevice::EnumEffects(LPDIENUMEFFECTSCALLBACK lpCallback, LPVOID pvRef, DWORD dwEffType) 48 | { 49 | return actualDirectInputDevice->EnumEffects(lpCallback, pvRef, dwEffType); 50 | } 51 | 52 | HRESULT WINAPI HOOKDirectInputDevice::EnumEffectsInFile(LPCWSTR lpszFileName, LPDIENUMEFFECTSINFILECALLBACK pec, LPVOID pvRef, DWORD dwFlags) 53 | { 54 | return actualDirectInputDevice->EnumEffectsInFile(lpszFileName, pec, pvRef, dwFlags); 55 | } 56 | 57 | HRESULT WINAPI HOOKDirectInputDevice::EnumObjects(LPDIENUMDEVICEOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD dwFlags) 58 | { 59 | return actualDirectInputDevice->EnumObjects(lpCallback, pvRef, dwFlags); 60 | } 61 | 62 | HRESULT WINAPI HOOKDirectInputDevice::Escape(LPDIEFFESCAPE pesc) 63 | { 64 | return actualDirectInputDevice->Escape(pesc); 65 | } 66 | 67 | HRESULT WINAPI HOOKDirectInputDevice::GetCapabilities(LPDIDEVCAPS lpDIDevCaps) 68 | { 69 | return actualDirectInputDevice->GetCapabilities(lpDIDevCaps); 70 | } 71 | 72 | HRESULT WINAPI HOOKDirectInputDevice::GetDeviceData(DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) 73 | { 74 | HRESULT res = actualDirectInputDevice->GetDeviceData(cbObjectData, rgdod, pdwInOut, dwFlags); 75 | if (FAILED(res)) 76 | return res; 77 | 78 | DWORD i; 79 | for (i = 0; i < *pdwInOut; i++) 80 | { 81 | if (rgdod[i].dwOfs == DIMOFS_Y) 82 | { 83 | /* 84 | Microsoft decided it would be funny to store signed values as DWORD here, 85 | which means that we'll be doing some ugly casting hacks to work around it. 86 | I'm sorry if you had to read this code. Blame 'Gates. 87 | */ 88 | 89 | int value = *(int*)&rgdod[i].dwData; 90 | rgdod[i].dwData = value * aspect; 91 | } 92 | } 93 | 94 | return res; 95 | } 96 | 97 | HRESULT WINAPI HOOKDirectInputDevice::GetDeviceInfo(LPDIDEVICEINSTANCE pdidi) 98 | { 99 | return actualDirectInputDevice->GetDeviceInfo(pdidi); 100 | } 101 | 102 | HRESULT WINAPI HOOKDirectInputDevice::GetDeviceState(DWORD cbData, LPVOID lpvData) 103 | { 104 | #if 0 105 | HRESULT res = actualDirectInputDevice->GetDeviceState(cbData, lpvData); 106 | if (FAILED(res)) 107 | return res; 108 | 109 | LPDIOBJECTDATAFORMAT obj_dfmt = dformat->rgodf; 110 | 111 | int i, n = dformat->dwNumObjs; 112 | for (i=0; iGetDeviceState(cbData, lpvData); 126 | } 127 | 128 | HRESULT WINAPI HOOKDirectInputDevice::GetEffectInfo(LPDIEFFECTINFO pdei, REFGUID rguid) 129 | { 130 | return actualDirectInputDevice->GetEffectInfo(pdei, rguid); 131 | } 132 | 133 | HRESULT WINAPI HOOKDirectInputDevice::GetForceFeedbackState(LPDWORD pdwOut) 134 | { 135 | return actualDirectInputDevice->GetForceFeedbackState(pdwOut); 136 | } 137 | 138 | HRESULT WINAPI HOOKDirectInputDevice::GetImageInfo(LPDIDEVICEIMAGEINFOHEADER lpdiDevImageInfoHeader) 139 | { 140 | return actualDirectInputDevice->GetImageInfo(lpdiDevImageInfoHeader); 141 | } 142 | 143 | HRESULT WINAPI HOOKDirectInputDevice::GetObjectInfo(LPDIDEVICEOBJECTINSTANCE pdidoi, DWORD dwObj, DWORD dwHow) 144 | { 145 | return actualDirectInputDevice->GetObjectInfo(pdidoi, dwObj, dwHow); 146 | } 147 | 148 | HRESULT WINAPI HOOKDirectInputDevice::GetProperty(REFGUID rguidProp, LPDIPROPHEADER pdiph) 149 | { 150 | return actualDirectInputDevice->GetProperty(rguidProp, pdiph); 151 | } 152 | 153 | HRESULT WINAPI HOOKDirectInputDevice::Initialize(HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) 154 | { 155 | return actualDirectInputDevice->Initialize(hinst, dwVersion, rguid); 156 | } 157 | 158 | HRESULT WINAPI HOOKDirectInputDevice::Poll() 159 | { 160 | return actualDirectInputDevice->Poll(); 161 | } 162 | 163 | HRESULT WINAPI HOOKDirectInputDevice::RunControlPanel(HWND hwndOwner, DWORD dwFlags) 164 | { 165 | return actualDirectInputDevice->RunControlPanel(hwndOwner, dwFlags); 166 | } 167 | 168 | HRESULT WINAPI HOOKDirectInputDevice::SendDeviceData(DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) 169 | { 170 | return actualDirectInputDevice->SendDeviceData(cbObjectData, rgdod, pdwInOut, fl); 171 | } 172 | 173 | HRESULT WINAPI HOOKDirectInputDevice::SendForceFeedbackCommand(DWORD dwFlags) 174 | { 175 | return actualDirectInputDevice->SendForceFeedbackCommand(dwFlags); 176 | } 177 | 178 | HRESULT WINAPI HOOKDirectInputDevice::SetActionMap(LPDIACTIONFORMAT lpdiActionFormat, LPCTSTR lptszUserName, DWORD dwFlags) 179 | { 180 | return actualDirectInputDevice->SetActionMap(lpdiActionFormat, lptszUserName, dwFlags); 181 | } 182 | 183 | HRESULT WINAPI HOOKDirectInputDevice::SetCooperativeLevel(HWND hwnd, DWORD dwFlags) 184 | { 185 | return actualDirectInputDevice->SetCooperativeLevel(hwnd, dwFlags); 186 | } 187 | 188 | HRESULT WINAPI HOOKDirectInputDevice::SetDataFormat(LPCDIDATAFORMAT lpdf) 189 | { 190 | dformat = lpdf; 191 | return actualDirectInputDevice->SetDataFormat(lpdf); 192 | } 193 | 194 | HRESULT WINAPI HOOKDirectInputDevice::SetEventNotification(HANDLE hEvent) 195 | { 196 | return actualDirectInputDevice->SetEventNotification(hEvent); 197 | } 198 | 199 | HRESULT WINAPI HOOKDirectInputDevice::SetProperty(REFGUID rguidProp, LPCDIPROPHEADER pdiph) 200 | { 201 | return actualDirectInputDevice->SetProperty(rguidProp, pdiph); 202 | } 203 | 204 | HRESULT WINAPI HOOKDirectInputDevice::Unacquire() 205 | { 206 | return actualDirectInputDevice->Unacquire(); 207 | } 208 | 209 | HRESULT WINAPI HOOKDirectInputDevice::WriteEffectToFile(LPCWSTR lpszFileName, DWORD dwEntries, LPDIFILEEFFECT rgDiFileEft, DWORD dwFlags) 210 | { 211 | return actualDirectInputDevice->WriteEffectToFile(lpszFileName, dwEntries, rgDiFileEft, dwFlags); 212 | } 213 | 214 | HOOKDirectInputDevice::HOOKDirectInputDevice(IDirectInputDevice8 *actual) 215 | { 216 | if (!isConfigLoaded) 217 | { 218 | FILE *f = NULL; 219 | errno_t err = fopen_s(&f, "sensitivity.txt", "r"); 220 | 221 | if (!err) 222 | { 223 | fscanf_s(f, "%f", &aspect); 224 | fclose(f); 225 | } 226 | 227 | isConfigLoaded = 1; 228 | 229 | } 230 | 231 | actualDirectInputDevice = actual; 232 | dformat = 0; 233 | } 234 | 235 | HOOKDirectInputDevice::~HOOKDirectInputDevice() 236 | { 237 | //??? 238 | } -------------------------------------------------------------------------------- /DInputWrapper/HOOKDirectInputDevice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class HOOKDirectInputDevice : public IDirectInputDevice8 4 | { 5 | private: 6 | IDirectInputDevice8 *actualDirectInputDevice; 7 | LPCDIDATAFORMAT dformat; 8 | 9 | public: 10 | HRESULT WINAPI QueryInterface(REFIID iid, void ** ppvObject); 11 | ULONG WINAPI AddRef(void); 12 | ULONG WINAPI Release(void); 13 | HRESULT WINAPI Acquire(); 14 | HRESULT WINAPI BuildActionMap(LPDIACTIONFORMAT lpdiaf, LPCTSTR lpszUserName, DWORD dwFlags); 15 | HRESULT WINAPI CreateEffect(REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter); 16 | HRESULT WINAPI EnumCreatedEffectObjects(LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl); 17 | HRESULT WINAPI EnumEffects(LPDIENUMEFFECTSCALLBACK lpCallback, LPVOID pvRef, DWORD dwEffType); 18 | HRESULT WINAPI EnumEffectsInFile(LPCWSTR lpszFileName, LPDIENUMEFFECTSINFILECALLBACK pec, LPVOID pvRef, DWORD dwFlags); 19 | HRESULT WINAPI EnumObjects(LPDIENUMDEVICEOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD dwFlags); 20 | HRESULT WINAPI Escape(LPDIEFFESCAPE pesc); 21 | HRESULT WINAPI GetCapabilities(LPDIDEVCAPS lpDIDevCaps); 22 | HRESULT WINAPI GetDeviceData(DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags); 23 | HRESULT WINAPI GetDeviceInfo(LPDIDEVICEINSTANCE pdidi); 24 | HRESULT WINAPI GetDeviceState(DWORD cbData, LPVOID lpvData); 25 | HRESULT WINAPI GetEffectInfo(LPDIEFFECTINFO pdei, REFGUID rguid); 26 | HRESULT WINAPI GetForceFeedbackState(LPDWORD pdwOut); 27 | HRESULT WINAPI GetImageInfo(LPDIDEVICEIMAGEINFOHEADER lpdiDevImageInfoHeader); 28 | HRESULT WINAPI GetObjectInfo(LPDIDEVICEOBJECTINSTANCE pdidoi, DWORD dwObj, DWORD dwHow); 29 | HRESULT WINAPI GetProperty(REFGUID rguidProp, LPDIPROPHEADER pdiph); 30 | HRESULT WINAPI Initialize(HINSTANCE hinst, DWORD dwVersion, REFGUID rguid); 31 | HRESULT WINAPI Poll(); 32 | HRESULT WINAPI RunControlPanel(HWND hwndOwner, DWORD dwFlags); 33 | HRESULT WINAPI SendDeviceData(DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl); 34 | HRESULT WINAPI SendForceFeedbackCommand(DWORD dwFlags); 35 | HRESULT WINAPI SetActionMap(LPDIACTIONFORMAT lpdiActionFormat, LPCTSTR lptszUserName, DWORD dwFlags); 36 | HRESULT WINAPI SetCooperativeLevel(HWND hwnd, DWORD dwFlags); 37 | HRESULT WINAPI SetDataFormat(LPCDIDATAFORMAT lpdf); 38 | HRESULT WINAPI SetEventNotification(HANDLE hEvent); 39 | HRESULT WINAPI SetProperty(REFGUID rguidProp, LPCDIPROPHEADER pdiph); 40 | HRESULT WINAPI Unacquire(); 41 | HRESULT WINAPI WriteEffectToFile(LPCWSTR lpszFileName, DWORD dwEntries, LPDIFILEEFFECT rgDiFileEft, DWORD dwFlags); 42 | 43 | HOOKDirectInputDevice(IDirectInputDevice8 *actual); 44 | virtual ~HOOKDirectInputDevice(void); 45 | }; -------------------------------------------------------------------------------- /DInputWrapper/LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /DInputWrapper/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DInputWrapper 3 | ======================================================================== 4 | 5 | Installation: 6 | Drop the dinput8.dll file into the .exe game folder and create the 7 | sensitivity.txt file there, this file should contain your aspect ratio. 8 | On the archive there are sample files for common aspect ratios. Copy and 9 | rename any of them to sensitivity.txt if they match your current monitor 10 | aspect ratio. 11 | 12 | If game fails to launch it's possible you need VCRedist 2015 installed. 13 | 14 | vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 15 | > DO NOT COPY dinput8.dll INTO YOUR SYSTEM FOLDER < 16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 17 | 18 | Removal: 19 | Simply delete the dinput8.dll file from the .exe folder. 20 | 21 | Code is protected by the GNU GENERAL PUBLIC LICENSE v2 general 22 | license, and may not be distributed in any shape or form without the 23 | the aforementioned license accompanying it. 24 | There is ABSOLUTELY no warranty on this piece of software to the 25 | extent permitted by law. 26 | -------------------------------------------------------------------------------- /DInputWrapper/dinput8.def: -------------------------------------------------------------------------------- 1 | LIBRARY dinput8 2 | 3 | EXPORTS 4 | DirectInput8Create 5 | -------------------------------------------------------------------------------- /DInputWrapper/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include 3 | 4 | #include "stdafx.h" 5 | 6 | BOOL APIENTRY DllMain( HMODULE hModule, 7 | DWORD ul_reason_for_call, 8 | LPVOID lpReserved 9 | ) 10 | { 11 | switch (ul_reason_for_call) 12 | { 13 | case DLL_PROCESS_ATTACH: 14 | case DLL_THREAD_ATTACH: 15 | case DLL_THREAD_DETACH: 16 | case DLL_PROCESS_DETACH: 17 | break; 18 | } 19 | return TRUE; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /DInputWrapper/sample_config_files/16x9 sensitivity.txt: -------------------------------------------------------------------------------- 1 | 1.777777777777778 -------------------------------------------------------------------------------- /DInputWrapper/sample_config_files/4x3 sensitivity.txt: -------------------------------------------------------------------------------- 1 | 1.333333333333333 -------------------------------------------------------------------------------- /DInputWrapper/sample_config_files/eyefinity 3x 16x9 sensitivity.txt: -------------------------------------------------------------------------------- 1 | 5.333333333333333 -------------------------------------------------------------------------------- /DInputWrapper/sample_config_files/ultrawide sensitivity.txt: -------------------------------------------------------------------------------- 1 | 2.37037037037037 -------------------------------------------------------------------------------- /DInputWrapper/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // DInputWrapper.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /DInputWrapper/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | #include "dinput.h" 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /DInputWrapper/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | --------------------------------------------------------------------------------