├── Resources └── Icon128.png ├── .gitignore ├── README.md ├── DirectInput.uplugin ├── LICENSE.md └── Source └── DirectInput ├── DirectInput.Build.cs ├── Public ├── DirectInput.h ├── DirectInputDevice.h ├── Joystick.h └── Bindings.h └── Private ├── DirectInputDevice.cpp ├── Joystick.cpp ├── DirectInput.cpp └── Bindings.cpp /Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dahnielson/UEDirectInput/HEAD/Resources/Icon128.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | Binaries/* 3 | Intermediate/* 4 | Plugins/*/Intermediate/* 5 | 6 | # Cache files for the editor to use 7 | DerivedDataCache/* 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Direct Input 2 | 3 | This plugin enables Unreal Engine handle input from Direct Input devices, such as racing wheels, and send Force Feedback to them. 4 | 5 | The code is ported from an old (non-Unreal) project to Unreal Engine and is made open source so that the code hopefully can be improved. 6 | 7 | Known issues: 8 | 9 | - Only enumerate devices meant for driving or flying (by design). 10 | -------------------------------------------------------------------------------- /DirectInput.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0", 5 | "FriendlyName": "Windows DirectInput", 6 | "Description": "Handle input from DirectInput devices", 7 | "Category": "InputDevices", 8 | "CreatedBy": "Anders Dahnielson", 9 | "CreatedByURL": "", 10 | "DocsURL": "", 11 | "MarketplaceURL": "", 12 | "SupportURL": "", 13 | "CanContainContent": true, 14 | "IsBetaVersion": true, 15 | "IsExperimentalVersion": false, 16 | "Installed": false, 17 | "Modules": [ 18 | { 19 | "Name": "DirectInput", 20 | "Type": "Runtime", 21 | "LoadingPhase": "Default" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Anders Dahnielson 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /Source/DirectInput/DirectInput.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class DirectInput : ModuleRules 6 | { 7 | public DirectInput(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicIncludePaths.AddRange( 12 | new string[] { 13 | // ... add public include paths required here ... 14 | } 15 | ); 16 | 17 | 18 | PrivateIncludePaths.AddRange( 19 | new string[] { 20 | // ... add other private include paths required here ... 21 | } 22 | ); 23 | 24 | 25 | PublicDependencyModuleNames.AddRange( 26 | new string[] 27 | { 28 | "Core", 29 | "CoreUObject", 30 | "Engine", 31 | "ApplicationCore", 32 | "InputCore", 33 | "Slate", 34 | "SlateCore", 35 | } 36 | ); 37 | 38 | 39 | PrivateDependencyModuleNames.AddRange( 40 | new string[] 41 | { 42 | "InputDevice", 43 | } 44 | ); 45 | 46 | 47 | DynamicallyLoadedModuleNames.AddRange( 48 | new string[] 49 | { 50 | // ... add any modules that your module loads dynamically here ... 51 | } 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Source/DirectInput/Public/DirectInput.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Anders Dahnielson 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, copy, 7 | * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 8 | * and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "CoreMinimal.h" 25 | #include "InputDevice/Public/IInputDevice.h" 26 | #include "InputDevice/Public/IInputDeviceModule.h" 27 | 28 | class IDInputDevice : public IInputDevice 29 | { 30 | public: 31 | IDInputDevice(const TSharedRef &InMessageHandler); 32 | virtual ~IDInputDevice() override {}; 33 | 34 | protected: 35 | TSharedRef MessageHandler; 36 | }; 37 | 38 | class FDirectInputModule : public IInputDeviceModule 39 | { 40 | virtual TSharedPtr CreateInputDevice(const TSharedRef &InMessageHandler) override; 41 | TSharedPtr DirectInputDevice; 42 | 43 | public: 44 | TSharedPtr& GetDirectInputDevice() { return DirectInputDevice; } 45 | 46 | virtual void StartupModule() override; 47 | virtual void ShutdownModule() override; 48 | 49 | static inline FDirectInputModule& Get() 50 | { 51 | return FModuleManager::LoadModuleChecked("DirectInput"); 52 | } 53 | 54 | static inline bool IsAvailable() 55 | { 56 | return FModuleManager::Get().IsModuleLoaded("DirectInput"); 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /Source/DirectInput/Public/DirectInputDevice.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Anders Dahnielson 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, copy, 7 | * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 8 | * and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "DirectInput.h" 25 | 26 | class FDirectInputDevice : public IDInputDevice 27 | { 28 | public: 29 | FDirectInputDevice(const TSharedRef &InMessageHandler); 30 | virtual ~FDirectInputDevice() override; 31 | /** Tick the interface (e.g. check for new controllers) */ 32 | virtual void Tick(float DeltaTime) override; 33 | /** Poll for controller state and send events if needed */ 34 | virtual void SendControllerEvents() override; 35 | /** Set which MessageHandler will get the events from SendControllerEvents. */ 36 | virtual void SetMessageHandler(const TSharedRef &InMessageHandler) override; 37 | /** Exec handler to allow console commands to be passed through for debugging */ 38 | virtual bool Exec(UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar) override; 39 | // IForceFeedbackSystem pass through functions 40 | virtual void SetChannelValue(int32 ControllerId, FForceFeedbackChannelType ChannelType, float Value) override; 41 | virtual void SetChannelValues(int32 ControllerId, const FForceFeedbackValues &Values) override; 42 | 43 | TArray AxisNames; 44 | TArray ButtonNames; 45 | TArray PovNames; 46 | 47 | FName DirectInputInterfaceName; 48 | 49 | private: 50 | float TimeSinceLastCheck; 51 | }; 52 | -------------------------------------------------------------------------------- /Source/DirectInput/Public/Joystick.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Anders Dahnielson 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, copy, 7 | * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 8 | * and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "Windows/WindowsApplication.h" 25 | 26 | #define DIRECTINPUT_VERSION 0x0800 27 | #include 28 | 29 | class FJoystick 30 | { 31 | public: 32 | FJoystick(LPDIRECTINPUTDEVICE8 device); 33 | ~FJoystick() = default; 34 | void Release() const; 35 | 36 | GUID GetProductGui() const; 37 | FString GetProductGuidAsString() const; 38 | FString GetProductName() const; 39 | 40 | GUID GetInstanceGuid() const; 41 | FString GetInstanceGuidAsString() const; 42 | FString GetInstanceName() const; 43 | 44 | GUID GetForceDriverGuid() const; 45 | FString GetForceDriverGuidAsString() const; 46 | 47 | uint32 GetNumAxes() const { return Capabilities.dwAxes; } 48 | uint32 GetNumButtons() const { return Capabilities.dwButtons; } 49 | uint32 GetNumPovs() const { return Capabilities.dwPOVs; } 50 | 51 | bool IsAvailable() const { return Available; } 52 | 53 | bool Poll(); 54 | 55 | int32 GetAxisValue(uint32 Axis) const; 56 | int32 GetButtonValue(uint32 Button) const; 57 | int32 GetPovValue(uint32 Pov) const; 58 | 59 | bool IsAxisChanged(uint32 Axis) const; 60 | bool IsButtonChanged(uint32 Button) const; 61 | bool IsPovChanged(uint32 Pov) const; 62 | 63 | FString GetAxisName(uint32 Axis) const; 64 | uint32 GetAxisMaxForce(uint32 Axis) const; 65 | uint32 GetAxisForceResolution(uint32 Axis) const; 66 | bool IsForceActuator(uint32 Axis) const; 67 | 68 | bool UpdateEffect(int Magnitude); 69 | 70 | BOOL EnumerateAxes(LPCDIDEVICEOBJECTINSTANCE ObjectInstance); 71 | 72 | private: 73 | bool TryAcquireDevice(); 74 | bool GetDeviceInfo(); 75 | bool GetCapabilities(); 76 | void GetObjects(); 77 | 78 | bool CreateEffect(uint32 Axis); 79 | bool StopEffect() const; 80 | 81 | LPDIRECTINPUTEFFECT Effect; 82 | LPDIRECTINPUTDEVICE8 Device; 83 | DIDEVICEINSTANCE Instance; 84 | DIDEVCAPS Capabilities; 85 | 86 | bool Available; 87 | 88 | DIJOYSTATE2 CurrentState; 89 | DIJOYSTATE2 PreviousState; 90 | 91 | DIEFFECT EffectConfig; 92 | 93 | LPCDIDEVICEOBJECTINSTANCE AxisInstances[8]; 94 | }; 95 | -------------------------------------------------------------------------------- /Source/DirectInput/Public/Bindings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Anders Dahnielson 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, copy, 7 | * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 8 | * and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "InputCoreTypes.h" 25 | 26 | struct FDirectInputKeyNames 27 | { 28 | static const FGamepadKeyNames::Type Axis1; 29 | static const FGamepadKeyNames::Type Axis2; 30 | static const FGamepadKeyNames::Type Axis3; 31 | static const FGamepadKeyNames::Type Axis4; 32 | static const FGamepadKeyNames::Type Axis5; 33 | static const FGamepadKeyNames::Type Axis6; 34 | static const FGamepadKeyNames::Type Axis7; 35 | static const FGamepadKeyNames::Type Axis8; 36 | 37 | static const FGamepadKeyNames::Type Button1; 38 | static const FGamepadKeyNames::Type Button2; 39 | static const FGamepadKeyNames::Type Button3; 40 | static const FGamepadKeyNames::Type Button4; 41 | static const FGamepadKeyNames::Type Button5; 42 | static const FGamepadKeyNames::Type Button6; 43 | static const FGamepadKeyNames::Type Button7; 44 | static const FGamepadKeyNames::Type Button8; 45 | static const FGamepadKeyNames::Type Button9; 46 | static const FGamepadKeyNames::Type Button10; 47 | static const FGamepadKeyNames::Type Button11; 48 | static const FGamepadKeyNames::Type Button12; 49 | static const FGamepadKeyNames::Type Button13; 50 | static const FGamepadKeyNames::Type Button14; 51 | static const FGamepadKeyNames::Type Button15; 52 | static const FGamepadKeyNames::Type Button16; 53 | static const FGamepadKeyNames::Type Button17; 54 | static const FGamepadKeyNames::Type Button18; 55 | static const FGamepadKeyNames::Type Button19; 56 | static const FGamepadKeyNames::Type Button20; 57 | static const FGamepadKeyNames::Type Button21; 58 | static const FGamepadKeyNames::Type Button22; 59 | static const FGamepadKeyNames::Type Button23; 60 | static const FGamepadKeyNames::Type Button24; 61 | static const FGamepadKeyNames::Type Button25; 62 | static const FGamepadKeyNames::Type Button26; 63 | static const FGamepadKeyNames::Type Button27; 64 | static const FGamepadKeyNames::Type Button28; 65 | static const FGamepadKeyNames::Type Button29; 66 | static const FGamepadKeyNames::Type Button30; 67 | static const FGamepadKeyNames::Type Button31; 68 | static const FGamepadKeyNames::Type Button32; 69 | static const FGamepadKeyNames::Type Button33; 70 | static const FGamepadKeyNames::Type Button34; 71 | static const FGamepadKeyNames::Type Button35; 72 | static const FGamepadKeyNames::Type Button36; 73 | static const FGamepadKeyNames::Type Button37; 74 | static const FGamepadKeyNames::Type Button38; 75 | static const FGamepadKeyNames::Type Button39; 76 | static const FGamepadKeyNames::Type Button40; 77 | static const FGamepadKeyNames::Type Button41; 78 | static const FGamepadKeyNames::Type Button42; 79 | static const FGamepadKeyNames::Type Button43; 80 | static const FGamepadKeyNames::Type Button44; 81 | static const FGamepadKeyNames::Type Button45; 82 | static const FGamepadKeyNames::Type Button46; 83 | static const FGamepadKeyNames::Type Button47; 84 | static const FGamepadKeyNames::Type Button48; 85 | static const FGamepadKeyNames::Type Button49; 86 | static const FGamepadKeyNames::Type Button50; 87 | static const FGamepadKeyNames::Type Button51; 88 | static const FGamepadKeyNames::Type Button52; 89 | static const FGamepadKeyNames::Type Button53; 90 | static const FGamepadKeyNames::Type Button54; 91 | static const FGamepadKeyNames::Type Button55; 92 | static const FGamepadKeyNames::Type Button56; 93 | static const FGamepadKeyNames::Type Button57; 94 | static const FGamepadKeyNames::Type Button58; 95 | static const FGamepadKeyNames::Type Button59; 96 | static const FGamepadKeyNames::Type Button60; 97 | static const FGamepadKeyNames::Type Button61; 98 | static const FGamepadKeyNames::Type Button62; 99 | static const FGamepadKeyNames::Type Button63; 100 | static const FGamepadKeyNames::Type Button64; 101 | static const FGamepadKeyNames::Type Button65; 102 | static const FGamepadKeyNames::Type Button66; 103 | static const FGamepadKeyNames::Type Button67; 104 | static const FGamepadKeyNames::Type Button68; 105 | static const FGamepadKeyNames::Type Button69; 106 | static const FGamepadKeyNames::Type Button70; 107 | static const FGamepadKeyNames::Type Button71; 108 | static const FGamepadKeyNames::Type Button72; 109 | static const FGamepadKeyNames::Type Button73; 110 | static const FGamepadKeyNames::Type Button74; 111 | static const FGamepadKeyNames::Type Button75; 112 | static const FGamepadKeyNames::Type Button76; 113 | static const FGamepadKeyNames::Type Button77; 114 | static const FGamepadKeyNames::Type Button78; 115 | static const FGamepadKeyNames::Type Button79; 116 | static const FGamepadKeyNames::Type Button80; 117 | static const FGamepadKeyNames::Type Button81; 118 | static const FGamepadKeyNames::Type Button82; 119 | static const FGamepadKeyNames::Type Button83; 120 | static const FGamepadKeyNames::Type Button84; 121 | static const FGamepadKeyNames::Type Button85; 122 | static const FGamepadKeyNames::Type Button86; 123 | static const FGamepadKeyNames::Type Button87; 124 | static const FGamepadKeyNames::Type Button88; 125 | static const FGamepadKeyNames::Type Button89; 126 | static const FGamepadKeyNames::Type Button90; 127 | static const FGamepadKeyNames::Type Button91; 128 | static const FGamepadKeyNames::Type Button92; 129 | static const FGamepadKeyNames::Type Button93; 130 | static const FGamepadKeyNames::Type Button94; 131 | static const FGamepadKeyNames::Type Button95; 132 | static const FGamepadKeyNames::Type Button96; 133 | static const FGamepadKeyNames::Type Button97; 134 | static const FGamepadKeyNames::Type Button98; 135 | static const FGamepadKeyNames::Type Button99; 136 | static const FGamepadKeyNames::Type Button100; 137 | static const FGamepadKeyNames::Type Button101; 138 | static const FGamepadKeyNames::Type Button102; 139 | static const FGamepadKeyNames::Type Button103; 140 | static const FGamepadKeyNames::Type Button104; 141 | static const FGamepadKeyNames::Type Button105; 142 | static const FGamepadKeyNames::Type Button106; 143 | static const FGamepadKeyNames::Type Button107; 144 | static const FGamepadKeyNames::Type Button108; 145 | static const FGamepadKeyNames::Type Button109; 146 | static const FGamepadKeyNames::Type Button110; 147 | static const FGamepadKeyNames::Type Button111; 148 | static const FGamepadKeyNames::Type Button112; 149 | static const FGamepadKeyNames::Type Button113; 150 | static const FGamepadKeyNames::Type Button114; 151 | static const FGamepadKeyNames::Type Button115; 152 | static const FGamepadKeyNames::Type Button116; 153 | static const FGamepadKeyNames::Type Button117; 154 | static const FGamepadKeyNames::Type Button118; 155 | static const FGamepadKeyNames::Type Button119; 156 | static const FGamepadKeyNames::Type Button120; 157 | static const FGamepadKeyNames::Type Button121; 158 | static const FGamepadKeyNames::Type Button122; 159 | static const FGamepadKeyNames::Type Button123; 160 | static const FGamepadKeyNames::Type Button124; 161 | static const FGamepadKeyNames::Type Button125; 162 | static const FGamepadKeyNames::Type Button126; 163 | static const FGamepadKeyNames::Type Button127; 164 | static const FGamepadKeyNames::Type Button128; 165 | 166 | static const FGamepadKeyNames::Type Pov1; 167 | static const FGamepadKeyNames::Type Pov2; 168 | static const FGamepadKeyNames::Type Pov3; 169 | static const FGamepadKeyNames::Type Pov4; 170 | }; 171 | 172 | struct FDirectInputKeys 173 | { 174 | static const FKey Axis1; 175 | static const FKey Axis2; 176 | static const FKey Axis3; 177 | static const FKey Axis4; 178 | static const FKey Axis5; 179 | static const FKey Axis6; 180 | static const FKey Axis7; 181 | static const FKey Axis8; 182 | 183 | static const FKey Button1; 184 | static const FKey Button2; 185 | static const FKey Button3; 186 | static const FKey Button4; 187 | static const FKey Button5; 188 | static const FKey Button6; 189 | static const FKey Button7; 190 | static const FKey Button8; 191 | static const FKey Button9; 192 | static const FKey Button10; 193 | static const FKey Button11; 194 | static const FKey Button12; 195 | static const FKey Button13; 196 | static const FKey Button14; 197 | static const FKey Button15; 198 | static const FKey Button16; 199 | static const FKey Button17; 200 | static const FKey Button18; 201 | static const FKey Button19; 202 | static const FKey Button20; 203 | static const FKey Button21; 204 | static const FKey Button22; 205 | static const FKey Button23; 206 | static const FKey Button24; 207 | static const FKey Button25; 208 | static const FKey Button26; 209 | static const FKey Button27; 210 | static const FKey Button28; 211 | static const FKey Button29; 212 | static const FKey Button30; 213 | static const FKey Button31; 214 | static const FKey Button32; 215 | static const FKey Button33; 216 | static const FKey Button34; 217 | static const FKey Button35; 218 | static const FKey Button36; 219 | static const FKey Button37; 220 | static const FKey Button38; 221 | static const FKey Button39; 222 | static const FKey Button40; 223 | static const FKey Button41; 224 | static const FKey Button42; 225 | static const FKey Button43; 226 | static const FKey Button44; 227 | static const FKey Button45; 228 | static const FKey Button46; 229 | static const FKey Button47; 230 | static const FKey Button48; 231 | static const FKey Button49; 232 | static const FKey Button50; 233 | static const FKey Button51; 234 | static const FKey Button52; 235 | static const FKey Button53; 236 | static const FKey Button54; 237 | static const FKey Button55; 238 | static const FKey Button56; 239 | static const FKey Button57; 240 | static const FKey Button58; 241 | static const FKey Button59; 242 | static const FKey Button60; 243 | static const FKey Button61; 244 | static const FKey Button62; 245 | static const FKey Button63; 246 | static const FKey Button64; 247 | static const FKey Button65; 248 | static const FKey Button66; 249 | static const FKey Button67; 250 | static const FKey Button68; 251 | static const FKey Button69; 252 | static const FKey Button70; 253 | static const FKey Button71; 254 | static const FKey Button72; 255 | static const FKey Button73; 256 | static const FKey Button74; 257 | static const FKey Button75; 258 | static const FKey Button76; 259 | static const FKey Button77; 260 | static const FKey Button78; 261 | static const FKey Button79; 262 | static const FKey Button80; 263 | static const FKey Button81; 264 | static const FKey Button82; 265 | static const FKey Button83; 266 | static const FKey Button84; 267 | static const FKey Button85; 268 | static const FKey Button86; 269 | static const FKey Button87; 270 | static const FKey Button88; 271 | static const FKey Button89; 272 | static const FKey Button90; 273 | static const FKey Button91; 274 | static const FKey Button92; 275 | static const FKey Button93; 276 | static const FKey Button94; 277 | static const FKey Button95; 278 | static const FKey Button96; 279 | static const FKey Button97; 280 | static const FKey Button98; 281 | static const FKey Button99; 282 | static const FKey Button100; 283 | static const FKey Button101; 284 | static const FKey Button102; 285 | static const FKey Button103; 286 | static const FKey Button104; 287 | static const FKey Button105; 288 | static const FKey Button106; 289 | static const FKey Button107; 290 | static const FKey Button108; 291 | static const FKey Button109; 292 | static const FKey Button110; 293 | static const FKey Button111; 294 | static const FKey Button112; 295 | static const FKey Button113; 296 | static const FKey Button114; 297 | static const FKey Button115; 298 | static const FKey Button116; 299 | static const FKey Button117; 300 | static const FKey Button118; 301 | static const FKey Button119; 302 | static const FKey Button120; 303 | static const FKey Button121; 304 | static const FKey Button122; 305 | static const FKey Button123; 306 | static const FKey Button124; 307 | static const FKey Button125; 308 | static const FKey Button126; 309 | static const FKey Button127; 310 | static const FKey Button128; 311 | 312 | static const FKey Pov1; 313 | static const FKey Pov2; 314 | static const FKey Pov3; 315 | static const FKey Pov4; 316 | }; 317 | -------------------------------------------------------------------------------- /Source/DirectInput/Private/DirectInputDevice.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Anders Dahnielson 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, copy, 7 | * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 8 | * and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include "DirectInputDevice.h" 23 | #include "Bindings.h" 24 | #include "Joystick.h" 25 | 26 | DEFINE_LOG_CATEGORY_STATIC(LogDirectInputDevice, Log, All); 27 | 28 | IDirectInput8* GInputObject = nullptr; 29 | TArray GInputDevices; 30 | 31 | static BOOL CALLBACK StaticEnumerateDevice(LPCDIDEVICEINSTANCE deviceInstance, LPVOID pvRef) 32 | { 33 | for (FJoystick& Joy : GInputDevices) 34 | { 35 | if (IsEqualGUID(deviceInstance->guidInstance, Joy.GetInstanceGuid())) 36 | return DIENUM_CONTINUE; 37 | } 38 | 39 | // const auto Device = static_cast(pvRef); 40 | 41 | LPDIRECTINPUTDEVICE8 InputDevice; 42 | if (GInputObject->CreateDevice(deviceInstance->guidInstance, &InputDevice, nullptr) == DI_OK) 43 | { 44 | GInputDevices.Emplace(InputDevice); 45 | } 46 | return DIENUM_CONTINUE; 47 | } 48 | 49 | FDirectInputDevice::FDirectInputDevice(const TSharedRef& InMessageHandler) : 50 | IDInputDevice(InMessageHandler), 51 | TimeSinceLastCheck(0) 52 | { 53 | AxisNames.AddDefaulted(8); 54 | ButtonNames.AddDefaulted(128); 55 | PovNames.AddDefaulted(4); 56 | 57 | AxisNames[0] = FDirectInputKeyNames::Axis1; 58 | AxisNames[1] = FDirectInputKeyNames::Axis2; 59 | AxisNames[2] = FDirectInputKeyNames::Axis3; 60 | AxisNames[3] = FDirectInputKeyNames::Axis4; 61 | AxisNames[4] = FDirectInputKeyNames::Axis5; 62 | AxisNames[5] = FDirectInputKeyNames::Axis6; 63 | AxisNames[6] = FDirectInputKeyNames::Axis7; 64 | AxisNames[7] = FDirectInputKeyNames::Axis8; 65 | 66 | ButtonNames[0] = FDirectInputKeyNames::Button1; 67 | ButtonNames[1] = FDirectInputKeyNames::Button2; 68 | ButtonNames[2] = FDirectInputKeyNames::Button3; 69 | ButtonNames[3] = FDirectInputKeyNames::Button4; 70 | ButtonNames[4] = FDirectInputKeyNames::Button5; 71 | ButtonNames[5] = FDirectInputKeyNames::Button6; 72 | ButtonNames[6] = FDirectInputKeyNames::Button7; 73 | ButtonNames[7] = FDirectInputKeyNames::Button8; 74 | ButtonNames[8] = FDirectInputKeyNames::Button9; 75 | ButtonNames[9] = FDirectInputKeyNames::Button10; 76 | ButtonNames[10] = FDirectInputKeyNames::Button11; 77 | ButtonNames[11] = FDirectInputKeyNames::Button12; 78 | ButtonNames[12] = FDirectInputKeyNames::Button13; 79 | ButtonNames[13] = FDirectInputKeyNames::Button14; 80 | ButtonNames[14] = FDirectInputKeyNames::Button15; 81 | ButtonNames[15] = FDirectInputKeyNames::Button16; 82 | ButtonNames[16] = FDirectInputKeyNames::Button17; 83 | ButtonNames[17] = FDirectInputKeyNames::Button18; 84 | ButtonNames[18] = FDirectInputKeyNames::Button19; 85 | ButtonNames[19] = FDirectInputKeyNames::Button20; 86 | ButtonNames[20] = FDirectInputKeyNames::Button21; 87 | ButtonNames[21] = FDirectInputKeyNames::Button22; 88 | ButtonNames[22] = FDirectInputKeyNames::Button23; 89 | ButtonNames[23] = FDirectInputKeyNames::Button24; 90 | ButtonNames[24] = FDirectInputKeyNames::Button25; 91 | ButtonNames[25] = FDirectInputKeyNames::Button26; 92 | ButtonNames[26] = FDirectInputKeyNames::Button27; 93 | ButtonNames[27] = FDirectInputKeyNames::Button28; 94 | ButtonNames[28] = FDirectInputKeyNames::Button29; 95 | ButtonNames[29] = FDirectInputKeyNames::Button30; 96 | ButtonNames[30] = FDirectInputKeyNames::Button31; 97 | ButtonNames[31] = FDirectInputKeyNames::Button32; 98 | ButtonNames[32] = FDirectInputKeyNames::Button33; 99 | ButtonNames[33] = FDirectInputKeyNames::Button34; 100 | ButtonNames[34] = FDirectInputKeyNames::Button35; 101 | ButtonNames[35] = FDirectInputKeyNames::Button36; 102 | ButtonNames[36] = FDirectInputKeyNames::Button37; 103 | ButtonNames[37] = FDirectInputKeyNames::Button38; 104 | ButtonNames[38] = FDirectInputKeyNames::Button39; 105 | ButtonNames[39] = FDirectInputKeyNames::Button40; 106 | ButtonNames[40] = FDirectInputKeyNames::Button41; 107 | ButtonNames[41] = FDirectInputKeyNames::Button42; 108 | ButtonNames[42] = FDirectInputKeyNames::Button43; 109 | ButtonNames[43] = FDirectInputKeyNames::Button44; 110 | ButtonNames[44] = FDirectInputKeyNames::Button45; 111 | ButtonNames[45] = FDirectInputKeyNames::Button46; 112 | ButtonNames[46] = FDirectInputKeyNames::Button47; 113 | ButtonNames[47] = FDirectInputKeyNames::Button48; 114 | ButtonNames[48] = FDirectInputKeyNames::Button49; 115 | ButtonNames[49] = FDirectInputKeyNames::Button50; 116 | ButtonNames[50] = FDirectInputKeyNames::Button51; 117 | ButtonNames[51] = FDirectInputKeyNames::Button52; 118 | ButtonNames[52] = FDirectInputKeyNames::Button53; 119 | ButtonNames[53] = FDirectInputKeyNames::Button54; 120 | ButtonNames[54] = FDirectInputKeyNames::Button55; 121 | ButtonNames[55] = FDirectInputKeyNames::Button56; 122 | ButtonNames[56] = FDirectInputKeyNames::Button57; 123 | ButtonNames[57] = FDirectInputKeyNames::Button58; 124 | ButtonNames[58] = FDirectInputKeyNames::Button59; 125 | ButtonNames[59] = FDirectInputKeyNames::Button60; 126 | ButtonNames[60] = FDirectInputKeyNames::Button61; 127 | ButtonNames[61] = FDirectInputKeyNames::Button62; 128 | ButtonNames[62] = FDirectInputKeyNames::Button63; 129 | ButtonNames[63] = FDirectInputKeyNames::Button64; 130 | ButtonNames[64] = FDirectInputKeyNames::Button65; 131 | ButtonNames[65] = FDirectInputKeyNames::Button66; 132 | ButtonNames[66] = FDirectInputKeyNames::Button67; 133 | ButtonNames[67] = FDirectInputKeyNames::Button68; 134 | ButtonNames[68] = FDirectInputKeyNames::Button69; 135 | ButtonNames[69] = FDirectInputKeyNames::Button70; 136 | ButtonNames[70] = FDirectInputKeyNames::Button71; 137 | ButtonNames[71] = FDirectInputKeyNames::Button72; 138 | ButtonNames[72] = FDirectInputKeyNames::Button73; 139 | ButtonNames[73] = FDirectInputKeyNames::Button74; 140 | ButtonNames[74] = FDirectInputKeyNames::Button75; 141 | ButtonNames[75] = FDirectInputKeyNames::Button76; 142 | ButtonNames[76] = FDirectInputKeyNames::Button77; 143 | ButtonNames[77] = FDirectInputKeyNames::Button78; 144 | ButtonNames[78] = FDirectInputKeyNames::Button79; 145 | ButtonNames[79] = FDirectInputKeyNames::Button80; 146 | ButtonNames[80] = FDirectInputKeyNames::Button81; 147 | ButtonNames[81] = FDirectInputKeyNames::Button82; 148 | ButtonNames[82] = FDirectInputKeyNames::Button83; 149 | ButtonNames[83] = FDirectInputKeyNames::Button84; 150 | ButtonNames[84] = FDirectInputKeyNames::Button85; 151 | ButtonNames[85] = FDirectInputKeyNames::Button86; 152 | ButtonNames[86] = FDirectInputKeyNames::Button87; 153 | ButtonNames[87] = FDirectInputKeyNames::Button88; 154 | ButtonNames[88] = FDirectInputKeyNames::Button89; 155 | ButtonNames[89] = FDirectInputKeyNames::Button90; 156 | ButtonNames[90] = FDirectInputKeyNames::Button91; 157 | ButtonNames[91] = FDirectInputKeyNames::Button92; 158 | ButtonNames[92] = FDirectInputKeyNames::Button93; 159 | ButtonNames[93] = FDirectInputKeyNames::Button94; 160 | ButtonNames[94] = FDirectInputKeyNames::Button95; 161 | ButtonNames[95] = FDirectInputKeyNames::Button96; 162 | ButtonNames[96] = FDirectInputKeyNames::Button97; 163 | ButtonNames[97] = FDirectInputKeyNames::Button98; 164 | ButtonNames[98] = FDirectInputKeyNames::Button99; 165 | ButtonNames[99] = FDirectInputKeyNames::Button100; 166 | ButtonNames[100] = FDirectInputKeyNames::Button101; 167 | ButtonNames[101] = FDirectInputKeyNames::Button102; 168 | ButtonNames[102] = FDirectInputKeyNames::Button103; 169 | ButtonNames[103] = FDirectInputKeyNames::Button104; 170 | ButtonNames[104] = FDirectInputKeyNames::Button105; 171 | ButtonNames[105] = FDirectInputKeyNames::Button106; 172 | ButtonNames[106] = FDirectInputKeyNames::Button107; 173 | ButtonNames[107] = FDirectInputKeyNames::Button108; 174 | ButtonNames[108] = FDirectInputKeyNames::Button109; 175 | ButtonNames[109] = FDirectInputKeyNames::Button110; 176 | ButtonNames[110] = FDirectInputKeyNames::Button111; 177 | ButtonNames[111] = FDirectInputKeyNames::Button112; 178 | ButtonNames[112] = FDirectInputKeyNames::Button113; 179 | ButtonNames[113] = FDirectInputKeyNames::Button114; 180 | ButtonNames[114] = FDirectInputKeyNames::Button115; 181 | ButtonNames[115] = FDirectInputKeyNames::Button116; 182 | ButtonNames[116] = FDirectInputKeyNames::Button117; 183 | ButtonNames[117] = FDirectInputKeyNames::Button118; 184 | ButtonNames[118] = FDirectInputKeyNames::Button119; 185 | ButtonNames[119] = FDirectInputKeyNames::Button120; 186 | ButtonNames[120] = FDirectInputKeyNames::Button121; 187 | ButtonNames[121] = FDirectInputKeyNames::Button122; 188 | ButtonNames[122] = FDirectInputKeyNames::Button123; 189 | ButtonNames[123] = FDirectInputKeyNames::Button124; 190 | ButtonNames[124] = FDirectInputKeyNames::Button125; 191 | ButtonNames[125] = FDirectInputKeyNames::Button126; 192 | ButtonNames[126] = FDirectInputKeyNames::Button127; 193 | ButtonNames[127] = FDirectInputKeyNames::Button128; 194 | 195 | PovNames[0] = FDirectInputKeyNames::Pov1; 196 | PovNames[1] = FDirectInputKeyNames::Pov2; 197 | PovNames[2] = FDirectInputKeyNames::Pov3; 198 | PovNames[3] = FDirectInputKeyNames::Pov4; 199 | 200 | if (DirectInput8Create(GetModuleHandle(nullptr), DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&GInputObject, nullptr) == DI_OK) 201 | { 202 | // Only enumerate devices meant for driving or flying that are currently attached 203 | GInputObject->EnumDevices(DI8DEVTYPE_DRIVING | DI8DEVTYPE_FLIGHT, &StaticEnumerateDevice, this, DIEDFL_ATTACHEDONLY); 204 | } 205 | } 206 | 207 | FDirectInputDevice::~FDirectInputDevice() 208 | { 209 | GInputDevices.Empty(); 210 | } 211 | 212 | void FDirectInputDevice::Tick(float DeltaTime) 213 | { 214 | TimeSinceLastCheck += DeltaTime; 215 | if (GInputObject != nullptr && TimeSinceLastCheck > 60) 216 | { 217 | TimeSinceLastCheck = 0; 218 | GInputObject->EnumDevices(DI8DEVTYPE_DRIVING, &StaticEnumerateDevice, this, DIEDFL_ATTACHEDONLY); 219 | } 220 | } 221 | 222 | void FDirectInputDevice::SendControllerEvents() 223 | { 224 | // Don't run if in editor 225 | if (GEngine->IsEditor()) 226 | { 227 | return; 228 | } 229 | 230 | int32 ControllerId = 0; 231 | for (FJoystick& Joy : GInputDevices) 232 | { 233 | FInputDeviceScope InputScope(this, DirectInputInterfaceName, ControllerId, Joy.GetInstanceName()); 234 | 235 | Joy.Poll(); 236 | 237 | for (uint32 Axis = 0; Axis < Joy.GetNumAxes(); Axis++) 238 | { 239 | if (Joy.IsAxisChanged(Axis)) 240 | { 241 | const int32 Value = Joy.GetAxisValue(Axis); 242 | //UE_LOG(LogDirectInputDevice, Log, TEXT("ControllerId %d Axis %d : %d"), ControllerId, Axis, Value); 243 | MessageHandler->OnControllerAnalog(AxisNames[Axis], ControllerId, Value); 244 | } 245 | } 246 | 247 | for (uint32 Button = 0; Button < Joy.GetNumButtons(); Button++) 248 | { 249 | if (Joy.IsButtonChanged(Button)) 250 | { 251 | if (Joy.GetButtonValue(Button)) 252 | { 253 | //UE_LOG(LogDirectInputDevice, Log, TEXT("ControllerId %d Button %d : pressed"), ControllerId, Button); 254 | MessageHandler->OnControllerButtonPressed(ButtonNames[Button], ControllerId, false); 255 | } 256 | else 257 | { 258 | //UE_LOG(LogDirectInputDevice, Log, TEXT("ControllerId %d Button %d : released"), ControllerId, Button); 259 | MessageHandler->OnControllerButtonReleased(ButtonNames[Button], ControllerId, false); 260 | } 261 | } 262 | } 263 | 264 | for (uint32 Pov = 0; Pov < Joy.GetNumPovs(); Pov++) 265 | { 266 | if (Joy.IsPovChanged(Pov)) 267 | { 268 | const uint32 Value = Joy.GetPovValue(Pov); 269 | //UE_LOG(LogDirectInputDevice, Log, TEXT("ControllerId %d POV %d : %d"), ControllerId, Pov, Value); 270 | MessageHandler->OnControllerAnalog(PovNames[Pov], ControllerId, Value); 271 | } 272 | } 273 | 274 | ControllerId++; 275 | } 276 | } 277 | 278 | void FDirectInputDevice::SetMessageHandler(const TSharedRef& InMessageHandler) 279 | { 280 | MessageHandler = InMessageHandler; 281 | } 282 | 283 | bool FDirectInputDevice::Exec(UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar) 284 | { 285 | return false; 286 | } 287 | 288 | void FDirectInputDevice::SetChannelValue(int32 ControllerId, FForceFeedbackChannelType ChannelType, float Value) 289 | { 290 | switch (ChannelType) 291 | { 292 | case FForceFeedbackChannelType::LEFT_LARGE: 293 | if (ControllerId < GInputDevices.Num()) 294 | { 295 | GInputDevices[ControllerId].UpdateEffect(Value); 296 | } 297 | break; 298 | case FForceFeedbackChannelType::LEFT_SMALL: 299 | // NOP 300 | break; 301 | case FForceFeedbackChannelType::RIGHT_LARGE: 302 | // NOP 303 | break; 304 | case FForceFeedbackChannelType::RIGHT_SMALL: 305 | // NOP 306 | break; 307 | default: 308 | break; 309 | } 310 | } 311 | 312 | void FDirectInputDevice::SetChannelValues(int32 ControllerId, const FForceFeedbackValues& Values) 313 | { 314 | if (ControllerId < GInputDevices.Num()) 315 | { 316 | GInputDevices[ControllerId].UpdateEffect(Values.LeftLarge); 317 | } 318 | } 319 | -------------------------------------------------------------------------------- /Source/DirectInput/Private/Joystick.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Anders Dahnielson 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, copy, 7 | * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 8 | * and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include "Joystick.h" 23 | 24 | DEFINE_LOG_CATEGORY_STATIC(LogJoystick, Log, All); 25 | 26 | static FString GuidToString(const GUID Guid) 27 | { 28 | WCHAR* WcharGuid = nullptr; 29 | switch (StringFromCLSID(Guid, &WcharGuid)) 30 | { 31 | case E_OUTOFMEMORY: 32 | return TEXT(""); 33 | default: 34 | break; 35 | } 36 | 37 | FString StringGuid = WcharGuid; 38 | CoTaskMemFree(WcharGuid); 39 | return StringGuid; 40 | } 41 | 42 | static HWND GetWindowHandle() 43 | { 44 | HWND hWnd = nullptr; 45 | 46 | const FWindowsApplication* WindowsApplication = static_cast(FSlateApplication::Get().GetPlatformApplication().Get()); 47 | check(WindowsApplication); 48 | 49 | const TSharedPtr ParentWindow = FSlateApplication::Get().GetActiveTopLevelWindow(); 50 | if (ParentWindow.IsValid() && (ParentWindow->GetNativeWindow().IsValid())) 51 | { 52 | hWnd = static_cast(ParentWindow->GetNativeWindow()->GetOSWindowHandle()); 53 | } 54 | 55 | return hWnd; 56 | } 57 | 58 | static BOOL CALLBACK StaticEnumerateAxes(LPCDIDEVICEOBJECTINSTANCE objectInstance, LPVOID pvRef) 59 | { 60 | const auto Instance = static_cast(pvRef); 61 | return Instance->EnumerateAxes(objectInstance); 62 | } 63 | 64 | BOOL FJoystick::EnumerateAxes(LPCDIDEVICEOBJECTINSTANCE ObjectInstance) 65 | { 66 | UE_LOG(LogJoystick, Display, TEXT("%s 0x%02X, 0x%02X '%s' : %d N / %d, actuator %d"), 67 | *GuidToString(ObjectInstance->guidType), 68 | ObjectInstance->wUsagePage, 69 | ObjectInstance->wUsage, 70 | ObjectInstance->tszName, 71 | ObjectInstance->dwFFMaxForce, 72 | ObjectInstance->dwFFForceResolution, 73 | ObjectInstance->dwFlags & DIDOI_FFACTUATOR 74 | ); 75 | 76 | if (ObjectInstance->wUsagePage == 0x01) 77 | { 78 | switch (ObjectInstance->wUsage) 79 | { 80 | case 0x30: // X 81 | AxisInstances[0] = ObjectInstance; 82 | break; 83 | case 0x31: // Y 84 | AxisInstances[1] = ObjectInstance; 85 | break; 86 | case 0x32: // Z 87 | AxisInstances[2] = ObjectInstance; 88 | break; 89 | case 0x33: // Rx 90 | AxisInstances[3] = ObjectInstance; 91 | break; 92 | case 0x34: // Ry 93 | AxisInstances[4] = ObjectInstance; 94 | break; 95 | case 0x35: // Rz 96 | AxisInstances[5] = ObjectInstance; 97 | break; 98 | case 0x36: // Slider 99 | AxisInstances[6] = ObjectInstance; 100 | break; 101 | case 0x37: // Dial 102 | AxisInstances[7] = ObjectInstance; 103 | break; 104 | default: 105 | UE_LOG(LogJoystick, Warning, TEXT("Unknown axis 0x%02X"), ObjectInstance->wUsage); 106 | break; 107 | } 108 | } 109 | else 110 | { 111 | UE_LOG(LogJoystick, Warning, TEXT("Unsupported HID page 0x%02X, usage 0x%02X"), ObjectInstance->wUsagePage, ObjectInstance->wUsage); 112 | } 113 | 114 | return DIENUM_CONTINUE; 115 | } 116 | 117 | FJoystick::FJoystick(LPDIRECTINPUTDEVICE8 device) : 118 | Device(device), 119 | Available(false) 120 | { 121 | ZeroMemory(&Instance, sizeof(DIDEVICEINSTANCE)); 122 | ZeroMemory(&Capabilities, sizeof(DIDEVCAPS)); 123 | ZeroMemory(&CurrentState, sizeof(DIJOYSTATE2)); 124 | ZeroMemory(&PreviousState, sizeof(DIJOYSTATE2)); 125 | 126 | Instance.dwSize = sizeof(DIDEVICEINSTANCE); 127 | Capabilities.dwSize = sizeof(DIDEVCAPS); 128 | 129 | if (TryAcquireDevice()) 130 | { 131 | GetDeviceInfo(); 132 | GetCapabilities(); 133 | GetObjects(); 134 | CreateEffect(0); 135 | } 136 | 137 | UE_LOG(LogJoystick, Display, TEXT("%s %s has %d axes, %d buttons and %d POVs"), *GetInstanceName(), *GetInstanceGuidAsString(), GetNumAxes(), GetNumButtons(), GetNumPovs()); 138 | } 139 | 140 | void FJoystick::Release() const 141 | { 142 | Device->Unacquire(); 143 | Effect->Release(); 144 | Device->Release(); 145 | } 146 | 147 | GUID FJoystick::GetProductGui() const 148 | { 149 | return Instance.guidProduct; 150 | } 151 | 152 | FString FJoystick::GetProductGuidAsString() const 153 | { 154 | return GuidToString(Instance.guidProduct); 155 | } 156 | 157 | FString FJoystick::GetProductName() const 158 | { 159 | return FString(Instance.tszProductName); 160 | } 161 | 162 | GUID FJoystick::GetInstanceGuid() const 163 | { 164 | return Instance.guidInstance; 165 | } 166 | 167 | FString FJoystick::GetInstanceGuidAsString() const 168 | { 169 | return GuidToString(Instance.guidInstance); 170 | } 171 | 172 | FString FJoystick::GetInstanceName() const 173 | { 174 | return FString(Instance.tszInstanceName); 175 | } 176 | 177 | GUID FJoystick::GetForceDriverGuid() const 178 | { 179 | return Instance.guidFFDriver; 180 | } 181 | 182 | FString FJoystick::GetForceDriverGuidAsString() const 183 | { 184 | return GuidToString(Instance.guidFFDriver); 185 | } 186 | 187 | bool FJoystick::TryAcquireDevice() 188 | { 189 | Device->Unacquire(); 190 | 191 | switch (Device->SetCooperativeLevel(GetWindowHandle(), DISCL_BACKGROUND | DISCL_EXCLUSIVE)) 192 | { 193 | case DIERR_INVALIDPARAM: 194 | UE_LOG(LogJoystick, Error, TEXT("SetCooperativeLevel: Invalid parameter")); 195 | break; 196 | case DIERR_NOTINITIALIZED: 197 | UE_LOG(LogJoystick, Error, TEXT("SetCooperativeLevel: Not initialized")); 198 | break; 199 | case E_HANDLE: 200 | UE_LOG(LogJoystick, Error, TEXT("SetCooperativeLevel: Handle")); 201 | break; 202 | default: 203 | break; 204 | } 205 | 206 | switch (Device->SetDataFormat(&c_dfDIJoystick2)) 207 | { 208 | case DIERR_ACQUIRED: 209 | UE_LOG(LogJoystick, Error, TEXT("SetDataFormat: Acquired")); 210 | break; 211 | case DIERR_INVALIDPARAM: 212 | UE_LOG(LogJoystick, Error, TEXT("SetDataFormat: Invalid parameter")); 213 | break; 214 | case DIERR_NOTINITIALIZED: 215 | UE_LOG(LogJoystick, Error, TEXT("SetDataFormat: Not initialized")); 216 | break; 217 | default: 218 | break; 219 | } 220 | 221 | switch (Device->Acquire()) 222 | { 223 | case DIERR_INVALIDPARAM: 224 | UE_LOG(LogJoystick, Error, TEXT("Acquire: Invalid parameter")); 225 | Available = false; 226 | return false; 227 | case DIERR_NOTINITIALIZED: 228 | UE_LOG(LogJoystick, Error, TEXT("Acquire: Not initialized")); 229 | Available = false; 230 | return false; 231 | case DIERR_OTHERAPPHASPRIO: 232 | UE_LOG(LogJoystick, Error, TEXT("Acquire: Other application has priority")); 233 | Available = false; 234 | return false; 235 | default: 236 | Available = true; 237 | return true; 238 | } 239 | } 240 | 241 | bool FJoystick::GetDeviceInfo() 242 | { 243 | switch (Device->GetDeviceInfo(&Instance)) 244 | { 245 | case DIERR_INVALIDPARAM: 246 | UE_LOG(LogJoystick, Error, TEXT("GetDeviceInfo: Invalid parameter")); 247 | return false; 248 | case DIERR_NOTINITIALIZED: 249 | UE_LOG(LogJoystick, Error, TEXT("GetDeviceInfo: Not initialized")); 250 | return false; 251 | case E_POINTER: 252 | UE_LOG(LogJoystick, Error, TEXT("GetDeviceInfo: Pointer")); 253 | return false; 254 | default: 255 | return true; 256 | } 257 | } 258 | 259 | bool FJoystick::GetCapabilities() 260 | { 261 | switch (Device->GetCapabilities(&Capabilities)) 262 | { 263 | case DIERR_INVALIDPARAM: 264 | UE_LOG(LogJoystick, Error, TEXT("GetCapabilities: Invalid parameter")); 265 | return false; 266 | case DIERR_NOTINITIALIZED: 267 | UE_LOG(LogJoystick, Error, TEXT("GetCapabilities: Not initialized")); 268 | return false; 269 | case E_POINTER: 270 | UE_LOG(LogJoystick, Error, TEXT("GetCapabilities: Pointer")); 271 | return false; 272 | default: 273 | return true; 274 | } 275 | } 276 | 277 | void FJoystick::GetObjects() 278 | { 279 | Device->EnumObjects(&StaticEnumerateAxes, this, DIDFT_AXIS); // DIDFT_AXIS | DIDFT_FFACTUATOR 280 | } 281 | 282 | bool FJoystick::Poll() 283 | { 284 | switch (Device->Poll()) 285 | { 286 | case DIERR_INPUTLOST: 287 | UE_LOG(LogJoystick, Error, TEXT("Poll: Input lost")); 288 | TryAcquireDevice(); 289 | return false; 290 | case DIERR_NOTINITIALIZED: 291 | UE_LOG(LogJoystick, Error, TEXT("Poll: Not initialized")); 292 | TryAcquireDevice(); 293 | return false; 294 | case DIERR_NOTACQUIRED: 295 | UE_LOG(LogJoystick, Error, TEXT("Poll: Not acquired")); 296 | TryAcquireDevice(); 297 | return false; 298 | case DIERR_OTHERAPPHASPRIO: 299 | UE_LOG(LogJoystick, Error, TEXT("Poll: Other application has priority")); 300 | return false; 301 | default: 302 | break; 303 | } 304 | 305 | CopyMemory(&PreviousState, &CurrentState, sizeof(DIJOYSTATE2)); 306 | ZeroMemory(&CurrentState, sizeof(DIJOYSTATE2)); 307 | 308 | switch (Device->GetDeviceState(sizeof(DIJOYSTATE2), &CurrentState)) 309 | { 310 | case DIERR_INPUTLOST: 311 | UE_LOG(LogJoystick, Error, TEXT("GetDeviceState: Input lost")); 312 | TryAcquireDevice(); 313 | return false; 314 | case DIERR_INVALIDPARAM: 315 | UE_LOG(LogJoystick, Error, TEXT("GetDeviceState: Invalid parameter")); 316 | TryAcquireDevice(); 317 | return false; 318 | case DIERR_NOTINITIALIZED: 319 | UE_LOG(LogJoystick, Error, TEXT("GetDeviceState: Not initialized")); 320 | TryAcquireDevice(); 321 | return false; 322 | case DIERR_NOTACQUIRED: 323 | UE_LOG(LogJoystick, Error, TEXT("GetDeviceState: Not acquired")); 324 | TryAcquireDevice(); 325 | return false; 326 | case E_PENDING: 327 | UE_LOG(LogJoystick, Error, TEXT("GetDeviceState: Pending")); 328 | return false; 329 | default: 330 | break; 331 | } 332 | 333 | return true; 334 | } 335 | 336 | int32 FJoystick::GetAxisValue(const uint32 Axis) const 337 | { 338 | int32 Value; 339 | 340 | switch (Axis) 341 | { 342 | case 0: 343 | Value = CurrentState.lX; 344 | break; 345 | case 1: 346 | Value = CurrentState.lY; 347 | break; 348 | case 2: 349 | Value = CurrentState.lZ; 350 | break; 351 | case 3: 352 | Value = CurrentState.lRx; 353 | break; 354 | case 4: 355 | Value = CurrentState.lRy; 356 | break; 357 | case 5: 358 | Value = CurrentState.lRz; 359 | break; 360 | case 6: 361 | Value = CurrentState.rglSlider[0]; 362 | break; 363 | case 7: 364 | Value = CurrentState.rglSlider[1]; 365 | break; 366 | default: 367 | Value = 0; 368 | break; 369 | } 370 | 371 | return Value; 372 | } 373 | 374 | int32 FJoystick::GetButtonValue(const uint32 Button) const 375 | { 376 | if (Button < GetNumButtons()) 377 | return (CurrentState.rgbButtons[Button] & 0x80) ? 1 : 0; 378 | 379 | return 0; 380 | } 381 | 382 | int32 FJoystick::GetPovValue(const uint32 Pov) const 383 | { 384 | if (Pov < GetNumPovs()) 385 | return static_cast(CurrentState.rgdwPOV[Pov]); 386 | 387 | return 0; 388 | } 389 | 390 | bool FJoystick::IsAxisChanged(const uint32 Axis) const 391 | { 392 | switch (Axis) 393 | { 394 | case 0: 395 | return CurrentState.lX != PreviousState.lX; 396 | case 1: 397 | return CurrentState.lY != PreviousState.lY; 398 | case 2: 399 | return CurrentState.lZ != PreviousState.lZ; 400 | case 3: 401 | return CurrentState.lRx != PreviousState.lRx; 402 | case 4: 403 | return CurrentState.lRy != PreviousState.lRy; 404 | case 5: 405 | return CurrentState.lRz != PreviousState.lRz; 406 | case 6: 407 | return CurrentState.rglSlider[0] != PreviousState.rglSlider[0]; 408 | case 7: 409 | return CurrentState.rglSlider[1] != PreviousState.rglSlider[1]; 410 | default: 411 | return false; 412 | } 413 | } 414 | 415 | bool FJoystick::IsButtonChanged(const uint32 Button) const 416 | { 417 | if (Button < GetNumButtons()) 418 | return CurrentState.rgbButtons[Button] != PreviousState.rgbButtons[Button]; 419 | 420 | return false; 421 | } 422 | 423 | bool FJoystick::IsPovChanged(const uint32 Pov) const 424 | { 425 | if (Pov < GetNumPovs()) 426 | return CurrentState.rgdwPOV[Pov] != PreviousState.rgdwPOV[Pov]; 427 | 428 | return false; 429 | } 430 | 431 | FString FJoystick::GetAxisName(const uint32 Axis) const 432 | { 433 | if (Axis > 7 || AxisInstances[Axis] == nullptr) 434 | return ""; 435 | 436 | return AxisInstances[Axis]->tszName; 437 | } 438 | 439 | uint32 FJoystick::GetAxisMaxForce(const uint32 Axis) const 440 | { 441 | if (Axis > 7 || AxisInstances[Axis] == nullptr) 442 | return 0; 443 | 444 | return AxisInstances[Axis]->dwFFMaxForce; 445 | } 446 | 447 | uint32 FJoystick::GetAxisForceResolution(const uint32 Axis) const 448 | { 449 | if (Axis > 7 || AxisInstances[Axis] == nullptr) 450 | return 0; 451 | 452 | return AxisInstances[Axis]->dwFFForceResolution; 453 | } 454 | 455 | bool FJoystick::IsForceActuator(uint32 Axis) const 456 | { 457 | if (Axis > 7 || AxisInstances[Axis] == nullptr) 458 | return false; 459 | 460 | return AxisInstances[Axis]->dwFlags & DIDOI_FFACTUATOR; 461 | } 462 | 463 | bool FJoystick::CreateEffect(uint32 Axis) 464 | { 465 | DWORD dwAxis; 466 | switch (Axis) 467 | { 468 | case 0: 469 | dwAxis = DIJOFS_X; 470 | break; 471 | case 1: 472 | dwAxis = DIJOFS_Y; 473 | break; 474 | case 2: 475 | dwAxis = DIJOFS_Z; 476 | break; 477 | case 3: 478 | dwAxis = DIJOFS_RX; 479 | break; 480 | case 4: 481 | dwAxis = DIJOFS_RY; 482 | break; 483 | case 5: 484 | dwAxis = DIJOFS_RZ; 485 | break; 486 | case 6: 487 | dwAxis = DIJOFS_SLIDER(0); 488 | break; 489 | case 7: 490 | dwAxis = DIJOFS_SLIDER(1); 491 | break; 492 | default: 493 | UE_LOG(LogJoystick, Warning, TEXT("Force feedback axis %d does not exist on %s"), Axis, *GetInstanceName()); 494 | return false; 495 | } 496 | 497 | DICONSTANTFORCE diConstantForce; 498 | diConstantForce.lMagnitude = 0; 499 | 500 | LONG direction = 0; 501 | 502 | ZeroMemory(&EffectConfig, sizeof(DIEFFECT)); 503 | EffectConfig.dwSize = sizeof(DIEFFECT); 504 | EffectConfig.dwFlags = DIEFF_CARTESIAN | DIEFF_OBJECTOFFSETS; 505 | EffectConfig.dwDuration = INFINITE; 506 | EffectConfig.dwSamplePeriod = 0; 507 | EffectConfig.dwGain = DI_FFNOMINALMAX; 508 | EffectConfig.dwTriggerButton = DIEB_NOTRIGGER; 509 | EffectConfig.dwTriggerRepeatInterval = 0; 510 | EffectConfig.cAxes = 1; 511 | EffectConfig.rgdwAxes = &dwAxis; 512 | EffectConfig.rglDirection = &direction; 513 | EffectConfig.lpEnvelope = nullptr; 514 | EffectConfig.cbTypeSpecificParams = sizeof(DICONSTANTFORCE); 515 | EffectConfig.lpvTypeSpecificParams = &diConstantForce; 516 | 517 | switch (Device->CreateEffect(GUID_ConstantForce, &EffectConfig, &Effect, nullptr)) 518 | { 519 | case DIERR_DEVICEFULL: 520 | UE_LOG(LogJoystick, Error, TEXT("CreateEffect: Device full : %s"), *GetInstanceGuidAsString()); 521 | return false; 522 | case DIERR_DEVICENOTREG: 523 | UE_LOG(LogJoystick, Error, TEXT("CreateEffect: Device not registered : %s"), *GetInstanceGuidAsString()); 524 | return false; 525 | case DIERR_INVALIDPARAM: 526 | UE_LOG(LogJoystick, Error, TEXT("CreateEffect: Invalid parameter")); 527 | return false; 528 | case DIERR_NOTINITIALIZED: 529 | UE_LOG(LogJoystick, Error, TEXT("CreateEffect: Not initialized")); 530 | return false; 531 | default: 532 | break; 533 | } 534 | 535 | switch (Effect->Start(INFINITE, 0)) 536 | { 537 | case DIERR_INCOMPLETEEFFECT: 538 | UE_LOG(LogJoystick, Error, TEXT("Start: Incomplete effect")); 539 | return false; 540 | case DIERR_INVALIDPARAM: 541 | UE_LOG(LogJoystick, Error, TEXT("Start: Invalid parameter")); 542 | return false; 543 | case DIERR_NOTEXCLUSIVEACQUIRED: 544 | UE_LOG(LogJoystick, Error, TEXT("Start: Not exclusive acquired")); 545 | return false; 546 | case DIERR_NOTINITIALIZED: 547 | UE_LOG(LogJoystick, Error, TEXT("Start: Not initialized")); 548 | return false; 549 | case DIERR_UNSUPPORTED: 550 | UE_LOG(LogJoystick, Error, TEXT("Start: Unsupported")); 551 | return false; 552 | default: 553 | return true; 554 | } 555 | } 556 | 557 | bool FJoystick::UpdateEffect(const int Magnitude) 558 | { 559 | DICONSTANTFORCE diConstantForce; 560 | diConstantForce.lMagnitude = Magnitude; 561 | 562 | EffectConfig.cbTypeSpecificParams = sizeof(DICONSTANTFORCE); 563 | EffectConfig.lpvTypeSpecificParams = &diConstantForce; 564 | 565 | switch (Effect->SetParameters(&EffectConfig, DIEP_TYPESPECIFICPARAMS | DIEP_START)) 566 | { 567 | case DIERR_NOTINITIALIZED: 568 | UE_LOG(LogJoystick, Error, TEXT("SetParameters: Not initialized")); 569 | return false; 570 | case DIERR_INCOMPLETEEFFECT: 571 | UE_LOG(LogJoystick, Error, TEXT("SetParameters: Incomplete effect")); 572 | return false; 573 | case DIERR_INPUTLOST: 574 | UE_LOG(LogJoystick, Error, TEXT("SetParameters: Input lost")); 575 | return false; 576 | case DIERR_INVALIDPARAM: 577 | UE_LOG(LogJoystick, Error, TEXT("SetParameters: Invalid parameter")); 578 | return false; 579 | case DIERR_EFFECTPLAYING: 580 | UE_LOG(LogJoystick, Error, TEXT("SetParameters: Effect playing")); 581 | return false; 582 | default: 583 | return true; 584 | } 585 | } 586 | 587 | bool FJoystick::StopEffect() const 588 | { 589 | switch (Effect->Stop()) 590 | { 591 | case DIERR_NOTEXCLUSIVEACQUIRED: 592 | UE_LOG(LogJoystick, Error, TEXT("Stop: Not exclusive acquired")); 593 | return false; 594 | case DIERR_NOTINITIALIZED: 595 | UE_LOG(LogJoystick, Error, TEXT("Stop: Not initialized")); 596 | return false; 597 | default: 598 | return true; 599 | } 600 | } 601 | -------------------------------------------------------------------------------- /Source/DirectInput/Private/DirectInput.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Anders Dahnielson 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, copy, 7 | * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 8 | * and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include "DirectInput.h" 23 | #include "DirectInputDevice.h" 24 | #include "Bindings.h" 25 | 26 | #pragma comment (lib, "dinput8.lib") 27 | #pragma comment (lib, "dxguid.lib") 28 | 29 | #define LOCTEXT_NAMESPACE "DirectInputPlugin" 30 | 31 | IDInputDevice::IDInputDevice(const TSharedRef< FGenericApplicationMessageHandler >& InMessageHandler) : 32 | MessageHandler(InMessageHandler) 33 | { 34 | }; 35 | 36 | TSharedPtr FDirectInputModule::CreateInputDevice(const TSharedRef& InMessageHandler) 37 | { 38 | DirectInputDevice = MakeShareable(new FDirectInputDevice(InMessageHandler)); 39 | return DirectInputDevice; 40 | } 41 | 42 | void FDirectInputModule::StartupModule() 43 | { 44 | IInputDeviceModule::StartupModule(); 45 | 46 | const FName NAME_DirectInput(TEXT("DirectInput")); 47 | 48 | EKeys::AddMenuCategoryDisplayInfo(NAME_DirectInput, LOCTEXT("DirectInputSubCateogry", "DirectInput"), TEXT("GraphEditor.KeyEvent_16x")); 49 | 50 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Axis1, LOCTEXT("DirectInput_Axis1", "Axis 1"), FKeyDetails::ButtonAxis, NAME_DirectInput)); 51 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Axis2, LOCTEXT("DirectInput_Axis1", "Axis 2"), FKeyDetails::ButtonAxis, NAME_DirectInput)); 52 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Axis3, LOCTEXT("DirectInput_Axis1", "Axis 3"), FKeyDetails::ButtonAxis, NAME_DirectInput)); 53 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Axis4, LOCTEXT("DirectInput_Axis1", "Axis 4"), FKeyDetails::ButtonAxis, NAME_DirectInput)); 54 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Axis5, LOCTEXT("DirectInput_Axis1", "Axis 5"), FKeyDetails::ButtonAxis, NAME_DirectInput)); 55 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Axis6, LOCTEXT("DirectInput_Axis1", "Axis 6"), FKeyDetails::ButtonAxis, NAME_DirectInput)); 56 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Axis7, LOCTEXT("DirectInput_Axis1", "Axis 7"), FKeyDetails::ButtonAxis, NAME_DirectInput)); 57 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Axis8, LOCTEXT("DirectInput_Axis1", "Axis 8"), FKeyDetails::ButtonAxis, NAME_DirectInput)); 58 | 59 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button1, LOCTEXT("DirectInput_Button1", "Button 1"), FKeyDetails::GamepadKey, NAME_DirectInput)); 60 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button2, LOCTEXT("DirectInput_Button2", "Button 2"), FKeyDetails::GamepadKey, NAME_DirectInput)); 61 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button3, LOCTEXT("DirectInput_Button3", "Button 3"), FKeyDetails::GamepadKey, NAME_DirectInput)); 62 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button4, LOCTEXT("DirectInput_Button4", "Button 4"), FKeyDetails::GamepadKey, NAME_DirectInput)); 63 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button5, LOCTEXT("DirectInput_Button5", "Button 5"), FKeyDetails::GamepadKey, NAME_DirectInput)); 64 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button6, LOCTEXT("DirectInput_Button6", "Button 6"), FKeyDetails::GamepadKey, NAME_DirectInput)); 65 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button7, LOCTEXT("DirectInput_Button7", "Button 7"), FKeyDetails::GamepadKey, NAME_DirectInput)); 66 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button8, LOCTEXT("DirectInput_Button8", "Button 8"), FKeyDetails::GamepadKey, NAME_DirectInput)); 67 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button9, LOCTEXT("DirectInput_Button9", "Button 9"), FKeyDetails::GamepadKey, NAME_DirectInput)); 68 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button10, LOCTEXT("DirectInput_Button10", "Button 10"), FKeyDetails::GamepadKey, NAME_DirectInput)); 69 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button11, LOCTEXT("DirectInput_Button11", "Button 11"), FKeyDetails::GamepadKey, NAME_DirectInput)); 70 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button12, LOCTEXT("DirectInput_Button12", "Button 12"), FKeyDetails::GamepadKey, NAME_DirectInput)); 71 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button13, LOCTEXT("DirectInput_Button13", "Button 13"), FKeyDetails::GamepadKey, NAME_DirectInput)); 72 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button14, LOCTEXT("DirectInput_Button14", "Button 14"), FKeyDetails::GamepadKey, NAME_DirectInput)); 73 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button15, LOCTEXT("DirectInput_Button15", "Button 15"), FKeyDetails::GamepadKey, NAME_DirectInput)); 74 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button16, LOCTEXT("DirectInput_Button16", "Button 16"), FKeyDetails::GamepadKey, NAME_DirectInput)); 75 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button17, LOCTEXT("DirectInput_Button17", "Button 17"), FKeyDetails::GamepadKey, NAME_DirectInput)); 76 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button18, LOCTEXT("DirectInput_Button18", "Button 18"), FKeyDetails::GamepadKey, NAME_DirectInput)); 77 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button19, LOCTEXT("DirectInput_Button19", "Button 19"), FKeyDetails::GamepadKey, NAME_DirectInput)); 78 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button20, LOCTEXT("DirectInput_Button20", "Button 20"), FKeyDetails::GamepadKey, NAME_DirectInput)); 79 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button21, LOCTEXT("DirectInput_Button21", "Button 21"), FKeyDetails::GamepadKey, NAME_DirectInput)); 80 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button22, LOCTEXT("DirectInput_Button22", "Button 22"), FKeyDetails::GamepadKey, NAME_DirectInput)); 81 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button23, LOCTEXT("DirectInput_Button23", "Button 23"), FKeyDetails::GamepadKey, NAME_DirectInput)); 82 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button24, LOCTEXT("DirectInput_Button24", "Button 24"), FKeyDetails::GamepadKey, NAME_DirectInput)); 83 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button25, LOCTEXT("DirectInput_Button25", "Button 25"), FKeyDetails::GamepadKey, NAME_DirectInput)); 84 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button26, LOCTEXT("DirectInput_Button26", "Button 26"), FKeyDetails::GamepadKey, NAME_DirectInput)); 85 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button27, LOCTEXT("DirectInput_Button27", "Button 27"), FKeyDetails::GamepadKey, NAME_DirectInput)); 86 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button28, LOCTEXT("DirectInput_Button28", "Button 28"), FKeyDetails::GamepadKey, NAME_DirectInput)); 87 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button29, LOCTEXT("DirectInput_Button29", "Button 29"), FKeyDetails::GamepadKey, NAME_DirectInput)); 88 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button30, LOCTEXT("DirectInput_Button30", "Button 30"), FKeyDetails::GamepadKey, NAME_DirectInput)); 89 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button31, LOCTEXT("DirectInput_Button31", "Button 31"), FKeyDetails::GamepadKey, NAME_DirectInput)); 90 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button32, LOCTEXT("DirectInput_Button32", "Button 32"), FKeyDetails::GamepadKey, NAME_DirectInput)); 91 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button33, LOCTEXT("DirectInput_Button33", "Button 33"), FKeyDetails::GamepadKey, NAME_DirectInput)); 92 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button34, LOCTEXT("DirectInput_Button34", "Button 34"), FKeyDetails::GamepadKey, NAME_DirectInput)); 93 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button35, LOCTEXT("DirectInput_Button35", "Button 35"), FKeyDetails::GamepadKey, NAME_DirectInput)); 94 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button36, LOCTEXT("DirectInput_Button36", "Button 36"), FKeyDetails::GamepadKey, NAME_DirectInput)); 95 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button37, LOCTEXT("DirectInput_Button37", "Button 37"), FKeyDetails::GamepadKey, NAME_DirectInput)); 96 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button38, LOCTEXT("DirectInput_Button38", "Button 38"), FKeyDetails::GamepadKey, NAME_DirectInput)); 97 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button39, LOCTEXT("DirectInput_Button39", "Button 39"), FKeyDetails::GamepadKey, NAME_DirectInput)); 98 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button40, LOCTEXT("DirectInput_Button40", "Button 40"), FKeyDetails::GamepadKey, NAME_DirectInput)); 99 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button41, LOCTEXT("DirectInput_Button41", "Button 41"), FKeyDetails::GamepadKey, NAME_DirectInput)); 100 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button42, LOCTEXT("DirectInput_Button42", "Button 42"), FKeyDetails::GamepadKey, NAME_DirectInput)); 101 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button43, LOCTEXT("DirectInput_Button43", "Button 43"), FKeyDetails::GamepadKey, NAME_DirectInput)); 102 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button44, LOCTEXT("DirectInput_Button44", "Button 44"), FKeyDetails::GamepadKey, NAME_DirectInput)); 103 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button45, LOCTEXT("DirectInput_Button45", "Button 45"), FKeyDetails::GamepadKey, NAME_DirectInput)); 104 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button46, LOCTEXT("DirectInput_Button46", "Button 46"), FKeyDetails::GamepadKey, NAME_DirectInput)); 105 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button47, LOCTEXT("DirectInput_Button47", "Button 47"), FKeyDetails::GamepadKey, NAME_DirectInput)); 106 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button48, LOCTEXT("DirectInput_Button48", "Button 48"), FKeyDetails::GamepadKey, NAME_DirectInput)); 107 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button49, LOCTEXT("DirectInput_Button49", "Button 49"), FKeyDetails::GamepadKey, NAME_DirectInput)); 108 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button50, LOCTEXT("DirectInput_Button50", "Button 50"), FKeyDetails::GamepadKey, NAME_DirectInput)); 109 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button51, LOCTEXT("DirectInput_Button51", "Button 51"), FKeyDetails::GamepadKey, NAME_DirectInput)); 110 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button52, LOCTEXT("DirectInput_Button52", "Button 52"), FKeyDetails::GamepadKey, NAME_DirectInput)); 111 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button53, LOCTEXT("DirectInput_Button53", "Button 53"), FKeyDetails::GamepadKey, NAME_DirectInput)); 112 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button54, LOCTEXT("DirectInput_Button54", "Button 54"), FKeyDetails::GamepadKey, NAME_DirectInput)); 113 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button55, LOCTEXT("DirectInput_Button55", "Button 55"), FKeyDetails::GamepadKey, NAME_DirectInput)); 114 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button56, LOCTEXT("DirectInput_Button56", "Button 56"), FKeyDetails::GamepadKey, NAME_DirectInput)); 115 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button57, LOCTEXT("DirectInput_Button57", "Button 57"), FKeyDetails::GamepadKey, NAME_DirectInput)); 116 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button58, LOCTEXT("DirectInput_Button58", "Button 58"), FKeyDetails::GamepadKey, NAME_DirectInput)); 117 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button59, LOCTEXT("DirectInput_Button59", "Button 59"), FKeyDetails::GamepadKey, NAME_DirectInput)); 118 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button60, LOCTEXT("DirectInput_Button60", "Button 60"), FKeyDetails::GamepadKey, NAME_DirectInput)); 119 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button61, LOCTEXT("DirectInput_Button61", "Button 61"), FKeyDetails::GamepadKey, NAME_DirectInput)); 120 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button62, LOCTEXT("DirectInput_Button62", "Button 62"), FKeyDetails::GamepadKey, NAME_DirectInput)); 121 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button63, LOCTEXT("DirectInput_Button63", "Button 63"), FKeyDetails::GamepadKey, NAME_DirectInput)); 122 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button64, LOCTEXT("DirectInput_Button64", "Button 64"), FKeyDetails::GamepadKey, NAME_DirectInput)); 123 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button65, LOCTEXT("DirectInput_Button65", "Button 65"), FKeyDetails::GamepadKey, NAME_DirectInput)); 124 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button66, LOCTEXT("DirectInput_Button66", "Button 66"), FKeyDetails::GamepadKey, NAME_DirectInput)); 125 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button67, LOCTEXT("DirectInput_Button67", "Button 67"), FKeyDetails::GamepadKey, NAME_DirectInput)); 126 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button68, LOCTEXT("DirectInput_Button68", "Button 68"), FKeyDetails::GamepadKey, NAME_DirectInput)); 127 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button69, LOCTEXT("DirectInput_Button69", "Button 69"), FKeyDetails::GamepadKey, NAME_DirectInput)); 128 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button70, LOCTEXT("DirectInput_Button70", "Button 70"), FKeyDetails::GamepadKey, NAME_DirectInput)); 129 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button71, LOCTEXT("DirectInput_Button71", "Button 71"), FKeyDetails::GamepadKey, NAME_DirectInput)); 130 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button72, LOCTEXT("DirectInput_Button72", "Button 72"), FKeyDetails::GamepadKey, NAME_DirectInput)); 131 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button73, LOCTEXT("DirectInput_Button73", "Button 73"), FKeyDetails::GamepadKey, NAME_DirectInput)); 132 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button74, LOCTEXT("DirectInput_Button74", "Button 74"), FKeyDetails::GamepadKey, NAME_DirectInput)); 133 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button75, LOCTEXT("DirectInput_Button75", "Button 75"), FKeyDetails::GamepadKey, NAME_DirectInput)); 134 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button76, LOCTEXT("DirectInput_Button76", "Button 76"), FKeyDetails::GamepadKey, NAME_DirectInput)); 135 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button77, LOCTEXT("DirectInput_Button77", "Button 77"), FKeyDetails::GamepadKey, NAME_DirectInput)); 136 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button78, LOCTEXT("DirectInput_Button78", "Button 78"), FKeyDetails::GamepadKey, NAME_DirectInput)); 137 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button79, LOCTEXT("DirectInput_Button79", "Button 79"), FKeyDetails::GamepadKey, NAME_DirectInput)); 138 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button80, LOCTEXT("DirectInput_Button80", "Button 80"), FKeyDetails::GamepadKey, NAME_DirectInput)); 139 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button81, LOCTEXT("DirectInput_Button81", "Button 81"), FKeyDetails::GamepadKey, NAME_DirectInput)); 140 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button82, LOCTEXT("DirectInput_Button82", "Button 82"), FKeyDetails::GamepadKey, NAME_DirectInput)); 141 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button83, LOCTEXT("DirectInput_Button83", "Button 83"), FKeyDetails::GamepadKey, NAME_DirectInput)); 142 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button84, LOCTEXT("DirectInput_Button84", "Button 84"), FKeyDetails::GamepadKey, NAME_DirectInput)); 143 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button85, LOCTEXT("DirectInput_Button85", "Button 85"), FKeyDetails::GamepadKey, NAME_DirectInput)); 144 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button86, LOCTEXT("DirectInput_Button86", "Button 86"), FKeyDetails::GamepadKey, NAME_DirectInput)); 145 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button87, LOCTEXT("DirectInput_Button87", "Button 87"), FKeyDetails::GamepadKey, NAME_DirectInput)); 146 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button88, LOCTEXT("DirectInput_Button88", "Button 88"), FKeyDetails::GamepadKey, NAME_DirectInput)); 147 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button89, LOCTEXT("DirectInput_Button89", "Button 89"), FKeyDetails::GamepadKey, NAME_DirectInput)); 148 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button90, LOCTEXT("DirectInput_Button90", "Button 90"), FKeyDetails::GamepadKey, NAME_DirectInput)); 149 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button91, LOCTEXT("DirectInput_Button91", "Button 91"), FKeyDetails::GamepadKey, NAME_DirectInput)); 150 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button92, LOCTEXT("DirectInput_Button92", "Button 92"), FKeyDetails::GamepadKey, NAME_DirectInput)); 151 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button93, LOCTEXT("DirectInput_Button93", "Button 93"), FKeyDetails::GamepadKey, NAME_DirectInput)); 152 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button94, LOCTEXT("DirectInput_Button94", "Button 94"), FKeyDetails::GamepadKey, NAME_DirectInput)); 153 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button95, LOCTEXT("DirectInput_Button95", "Button 95"), FKeyDetails::GamepadKey, NAME_DirectInput)); 154 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button96, LOCTEXT("DirectInput_Button96", "Button 96"), FKeyDetails::GamepadKey, NAME_DirectInput)); 155 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button97, LOCTEXT("DirectInput_Button97", "Button 97"), FKeyDetails::GamepadKey, NAME_DirectInput)); 156 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button98, LOCTEXT("DirectInput_Button98", "Button 98"), FKeyDetails::GamepadKey, NAME_DirectInput)); 157 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button99, LOCTEXT("DirectInput_Button99", "Button 99"), FKeyDetails::GamepadKey, NAME_DirectInput)); 158 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button100, LOCTEXT("DirectInput_Button100", "Button 100"), FKeyDetails::GamepadKey, NAME_DirectInput)); 159 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button101, LOCTEXT("DirectInput_Button101", "Button 101"), FKeyDetails::GamepadKey, NAME_DirectInput)); 160 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button102, LOCTEXT("DirectInput_Button102", "Button 102"), FKeyDetails::GamepadKey, NAME_DirectInput)); 161 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button103, LOCTEXT("DirectInput_Button103", "Button 103"), FKeyDetails::GamepadKey, NAME_DirectInput)); 162 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button104, LOCTEXT("DirectInput_Button104", "Button 104"), FKeyDetails::GamepadKey, NAME_DirectInput)); 163 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button105, LOCTEXT("DirectInput_Button105", "Button 105"), FKeyDetails::GamepadKey, NAME_DirectInput)); 164 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button106, LOCTEXT("DirectInput_Button106", "Button 106"), FKeyDetails::GamepadKey, NAME_DirectInput)); 165 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button107, LOCTEXT("DirectInput_Button107", "Button 107"), FKeyDetails::GamepadKey, NAME_DirectInput)); 166 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button108, LOCTEXT("DirectInput_Button108", "Button 108"), FKeyDetails::GamepadKey, NAME_DirectInput)); 167 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button109, LOCTEXT("DirectInput_Button109", "Button 109"), FKeyDetails::GamepadKey, NAME_DirectInput)); 168 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button110, LOCTEXT("DirectInput_Button110", "Button 110"), FKeyDetails::GamepadKey, NAME_DirectInput)); 169 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button111, LOCTEXT("DirectInput_Button111", "Button 111"), FKeyDetails::GamepadKey, NAME_DirectInput)); 170 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button112, LOCTEXT("DirectInput_Button112", "Button 112"), FKeyDetails::GamepadKey, NAME_DirectInput)); 171 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button113, LOCTEXT("DirectInput_Button113", "Button 113"), FKeyDetails::GamepadKey, NAME_DirectInput)); 172 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button114, LOCTEXT("DirectInput_Button114", "Button 114"), FKeyDetails::GamepadKey, NAME_DirectInput)); 173 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button115, LOCTEXT("DirectInput_Button115", "Button 115"), FKeyDetails::GamepadKey, NAME_DirectInput)); 174 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button116, LOCTEXT("DirectInput_Button116", "Button 116"), FKeyDetails::GamepadKey, NAME_DirectInput)); 175 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button117, LOCTEXT("DirectInput_Button117", "Button 117"), FKeyDetails::GamepadKey, NAME_DirectInput)); 176 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button118, LOCTEXT("DirectInput_Button118", "Button 118"), FKeyDetails::GamepadKey, NAME_DirectInput)); 177 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button119, LOCTEXT("DirectInput_Button119", "Button 119"), FKeyDetails::GamepadKey, NAME_DirectInput)); 178 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button120, LOCTEXT("DirectInput_Button120", "Button 120"), FKeyDetails::GamepadKey, NAME_DirectInput)); 179 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button121, LOCTEXT("DirectInput_Button121", "Button 121"), FKeyDetails::GamepadKey, NAME_DirectInput)); 180 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button122, LOCTEXT("DirectInput_Button122", "Button 122"), FKeyDetails::GamepadKey, NAME_DirectInput)); 181 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button123, LOCTEXT("DirectInput_Button123", "Button 123"), FKeyDetails::GamepadKey, NAME_DirectInput)); 182 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button124, LOCTEXT("DirectInput_Button124", "Button 124"), FKeyDetails::GamepadKey, NAME_DirectInput)); 183 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button125, LOCTEXT("DirectInput_Button125", "Button 125"), FKeyDetails::GamepadKey, NAME_DirectInput)); 184 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button126, LOCTEXT("DirectInput_Button126", "Button 126"), FKeyDetails::GamepadKey, NAME_DirectInput)); 185 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button127, LOCTEXT("DirectInput_Button127", "Button 127"), FKeyDetails::GamepadKey, NAME_DirectInput)); 186 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Button128, LOCTEXT("DirectInput_Button128", "Button 128"), FKeyDetails::GamepadKey, NAME_DirectInput)); 187 | 188 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Pov1, LOCTEXT("DirectInput_Pov1", "POV 1"), FKeyDetails::Axis1D, NAME_DirectInput)); 189 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Pov2, LOCTEXT("DirectInput_Pov1", "POV 2"), FKeyDetails::Axis1D, NAME_DirectInput)); 190 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Pov3, LOCTEXT("DirectInput_Pov1", "POV 3"), FKeyDetails::Axis1D, NAME_DirectInput)); 191 | EKeys::AddKey(FKeyDetails(FDirectInputKeys::Pov4, LOCTEXT("DirectInput_Pov1", "POV 4"), FKeyDetails::Axis1D, NAME_DirectInput)); 192 | } 193 | 194 | void FDirectInputModule::ShutdownModule() 195 | { 196 | IInputDeviceModule::ShutdownModule(); 197 | } 198 | 199 | IMPLEMENT_MODULE(FDirectInputModule, DirectInput) 200 | -------------------------------------------------------------------------------- /Source/DirectInput/Private/Bindings.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Anders Dahnielson 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | * this software and associated documentation files (the "Software"), to deal in the 6 | * Software without restriction, including without limitation the rights to use, copy, 7 | * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 8 | * and to permit persons to whom the Software is furnished to do so, subject to the 9 | * following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in all 12 | * copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 15 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 16 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 17 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 19 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | */ 21 | 22 | #include "Bindings.h" 23 | 24 | // FName 25 | const FGamepadKeyNames::Type FDirectInputKeyNames::Axis1("DirectInput_Axis1"); 26 | const FGamepadKeyNames::Type FDirectInputKeyNames::Axis2("DirectInput_Axis2"); 27 | const FGamepadKeyNames::Type FDirectInputKeyNames::Axis3("DirectInput_Axis3"); 28 | const FGamepadKeyNames::Type FDirectInputKeyNames::Axis4("DirectInput_Axis4"); 29 | const FGamepadKeyNames::Type FDirectInputKeyNames::Axis5("DirectInput_Axis5"); 30 | const FGamepadKeyNames::Type FDirectInputKeyNames::Axis6("DirectInput_Axis6"); 31 | const FGamepadKeyNames::Type FDirectInputKeyNames::Axis7("DirectInput_Axis7"); 32 | const FGamepadKeyNames::Type FDirectInputKeyNames::Axis8("DirectInput_Axis8"); 33 | 34 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button1("DirectInput_Button1"); 35 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button2("DirectInput_Button2"); 36 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button3("DirectInput_Button3"); 37 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button4("DirectInput_Button4"); 38 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button5("DirectInput_Button5"); 39 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button6("DirectInput_Button6"); 40 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button7("DirectInput_Button7"); 41 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button8("DirectInput_Button8"); 42 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button9("DirectInput_Button9"); 43 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button10("DirectInput_Button10"); 44 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button11("DirectInput_Button11"); 45 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button12("DirectInput_Button12"); 46 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button13("DirectInput_Button13"); 47 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button14("DirectInput_Button14"); 48 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button15("DirectInput_Button15"); 49 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button16("DirectInput_Button16"); 50 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button17("DirectInput_Button17"); 51 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button18("DirectInput_Button18"); 52 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button19("DirectInput_Button19"); 53 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button20("DirectInput_Button20"); 54 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button21("DirectInput_Button21"); 55 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button22("DirectInput_Button22"); 56 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button23("DirectInput_Button23"); 57 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button24("DirectInput_Button24"); 58 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button25("DirectInput_Button25"); 59 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button26("DirectInput_Button26"); 60 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button27("DirectInput_Button27"); 61 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button28("DirectInput_Button28"); 62 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button29("DirectInput_Button29"); 63 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button30("DirectInput_Button30"); 64 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button31("DirectInput_Button31"); 65 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button32("DirectInput_Button32"); 66 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button33("DirectInput_Button33"); 67 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button34("DirectInput_Button34"); 68 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button35("DirectInput_Button35"); 69 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button36("DirectInput_Button36"); 70 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button37("DirectInput_Button37"); 71 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button38("DirectInput_Button38"); 72 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button39("DirectInput_Button39"); 73 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button40("DirectInput_Button40"); 74 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button41("DirectInput_Button41"); 75 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button42("DirectInput_Button42"); 76 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button43("DirectInput_Button43"); 77 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button44("DirectInput_Button44"); 78 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button45("DirectInput_Button45"); 79 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button46("DirectInput_Button46"); 80 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button47("DirectInput_Button47"); 81 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button48("DirectInput_Button48"); 82 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button49("DirectInput_Button49"); 83 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button50("DirectInput_Button50"); 84 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button51("DirectInput_Button51"); 85 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button52("DirectInput_Button52"); 86 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button53("DirectInput_Button53"); 87 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button54("DirectInput_Button54"); 88 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button55("DirectInput_Button55"); 89 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button56("DirectInput_Button56"); 90 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button57("DirectInput_Button57"); 91 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button58("DirectInput_Button58"); 92 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button59("DirectInput_Button59"); 93 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button60("DirectInput_Button60"); 94 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button61("DirectInput_Button61"); 95 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button62("DirectInput_Button62"); 96 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button63("DirectInput_Button63"); 97 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button64("DirectInput_Button64"); 98 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button65("DirectInput_Button65"); 99 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button66("DirectInput_Button66"); 100 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button67("DirectInput_Button67"); 101 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button68("DirectInput_Button68"); 102 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button69("DirectInput_Button69"); 103 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button70("DirectInput_Button70"); 104 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button71("DirectInput_Button71"); 105 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button72("DirectInput_Button72"); 106 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button73("DirectInput_Button73"); 107 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button74("DirectInput_Button74"); 108 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button75("DirectInput_Button75"); 109 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button76("DirectInput_Button76"); 110 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button77("DirectInput_Button77"); 111 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button78("DirectInput_Button78"); 112 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button79("DirectInput_Button79"); 113 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button80("DirectInput_Button80"); 114 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button81("DirectInput_Button81"); 115 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button82("DirectInput_Button82"); 116 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button83("DirectInput_Button83"); 117 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button84("DirectInput_Button84"); 118 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button85("DirectInput_Button85"); 119 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button86("DirectInput_Button86"); 120 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button87("DirectInput_Button87"); 121 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button88("DirectInput_Button88"); 122 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button89("DirectInput_Button89"); 123 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button90("DirectInput_Button90"); 124 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button91("DirectInput_Button91"); 125 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button92("DirectInput_Button92"); 126 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button93("DirectInput_Button93"); 127 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button94("DirectInput_Button94"); 128 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button95("DirectInput_Button95"); 129 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button96("DirectInput_Button96"); 130 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button97("DirectInput_Button97"); 131 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button98("DirectInput_Button98"); 132 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button99("DirectInput_Button99"); 133 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button100("DirectInput_Button100"); 134 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button101("DirectInput_Button101"); 135 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button102("DirectInput_Button102"); 136 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button103("DirectInput_Button103"); 137 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button104("DirectInput_Button104"); 138 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button105("DirectInput_Button105"); 139 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button106("DirectInput_Button106"); 140 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button107("DirectInput_Button107"); 141 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button108("DirectInput_Button108"); 142 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button109("DirectInput_Button109"); 143 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button110("DirectInput_Button110"); 144 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button111("DirectInput_Button111"); 145 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button112("DirectInput_Button112"); 146 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button113("DirectInput_Button113"); 147 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button114("DirectInput_Button114"); 148 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button115("DirectInput_Button115"); 149 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button116("DirectInput_Button116"); 150 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button117("DirectInput_Button117"); 151 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button118("DirectInput_Button118"); 152 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button119("DirectInput_Button119"); 153 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button120("DirectInput_Button120"); 154 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button121("DirectInput_Button121"); 155 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button122("DirectInput_Button122"); 156 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button123("DirectInput_Button123"); 157 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button124("DirectInput_Button124"); 158 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button125("DirectInput_Button125"); 159 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button126("DirectInput_Button126"); 160 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button127("DirectInput_Button127"); 161 | const FGamepadKeyNames::Type FDirectInputKeyNames::Button128("DirectInput_Button128"); 162 | 163 | const FGamepadKeyNames::Type FDirectInputKeyNames::Pov1("DirectInput_Pov1"); 164 | const FGamepadKeyNames::Type FDirectInputKeyNames::Pov2("DirectInput_Pov2"); 165 | const FGamepadKeyNames::Type FDirectInputKeyNames::Pov3("DirectInput_Pov3"); 166 | const FGamepadKeyNames::Type FDirectInputKeyNames::Pov4("DirectInput_Pov4"); 167 | 168 | // FKey 169 | const FKey FDirectInputKeys::Axis1(FDirectInputKeyNames::Axis1); 170 | const FKey FDirectInputKeys::Axis2(FDirectInputKeyNames::Axis2); 171 | const FKey FDirectInputKeys::Axis3(FDirectInputKeyNames::Axis3); 172 | const FKey FDirectInputKeys::Axis4(FDirectInputKeyNames::Axis4); 173 | const FKey FDirectInputKeys::Axis5(FDirectInputKeyNames::Axis5); 174 | const FKey FDirectInputKeys::Axis6(FDirectInputKeyNames::Axis6); 175 | const FKey FDirectInputKeys::Axis7(FDirectInputKeyNames::Axis7); 176 | const FKey FDirectInputKeys::Axis8(FDirectInputKeyNames::Axis8); 177 | 178 | const FKey FDirectInputKeys::Button1(FDirectInputKeyNames::Button1); 179 | const FKey FDirectInputKeys::Button2(FDirectInputKeyNames::Button2); 180 | const FKey FDirectInputKeys::Button3(FDirectInputKeyNames::Button3); 181 | const FKey FDirectInputKeys::Button4(FDirectInputKeyNames::Button4); 182 | const FKey FDirectInputKeys::Button5(FDirectInputKeyNames::Button5); 183 | const FKey FDirectInputKeys::Button6(FDirectInputKeyNames::Button6); 184 | const FKey FDirectInputKeys::Button7(FDirectInputKeyNames::Button7); 185 | const FKey FDirectInputKeys::Button8(FDirectInputKeyNames::Button8); 186 | const FKey FDirectInputKeys::Button9(FDirectInputKeyNames::Button9); 187 | const FKey FDirectInputKeys::Button10(FDirectInputKeyNames::Button10); 188 | const FKey FDirectInputKeys::Button11(FDirectInputKeyNames::Button11); 189 | const FKey FDirectInputKeys::Button12(FDirectInputKeyNames::Button12); 190 | const FKey FDirectInputKeys::Button13(FDirectInputKeyNames::Button13); 191 | const FKey FDirectInputKeys::Button14(FDirectInputKeyNames::Button14); 192 | const FKey FDirectInputKeys::Button15(FDirectInputKeyNames::Button15); 193 | const FKey FDirectInputKeys::Button16(FDirectInputKeyNames::Button16); 194 | const FKey FDirectInputKeys::Button17(FDirectInputKeyNames::Button17); 195 | const FKey FDirectInputKeys::Button18(FDirectInputKeyNames::Button18); 196 | const FKey FDirectInputKeys::Button19(FDirectInputKeyNames::Button19); 197 | const FKey FDirectInputKeys::Button20(FDirectInputKeyNames::Button20); 198 | const FKey FDirectInputKeys::Button21(FDirectInputKeyNames::Button21); 199 | const FKey FDirectInputKeys::Button22(FDirectInputKeyNames::Button22); 200 | const FKey FDirectInputKeys::Button23(FDirectInputKeyNames::Button23); 201 | const FKey FDirectInputKeys::Button24(FDirectInputKeyNames::Button24); 202 | const FKey FDirectInputKeys::Button25(FDirectInputKeyNames::Button25); 203 | const FKey FDirectInputKeys::Button26(FDirectInputKeyNames::Button26); 204 | const FKey FDirectInputKeys::Button27(FDirectInputKeyNames::Button27); 205 | const FKey FDirectInputKeys::Button28(FDirectInputKeyNames::Button28); 206 | const FKey FDirectInputKeys::Button29(FDirectInputKeyNames::Button29); 207 | const FKey FDirectInputKeys::Button30(FDirectInputKeyNames::Button30); 208 | const FKey FDirectInputKeys::Button31(FDirectInputKeyNames::Button31); 209 | const FKey FDirectInputKeys::Button32(FDirectInputKeyNames::Button32); 210 | const FKey FDirectInputKeys::Button33(FDirectInputKeyNames::Button33); 211 | const FKey FDirectInputKeys::Button34(FDirectInputKeyNames::Button34); 212 | const FKey FDirectInputKeys::Button35(FDirectInputKeyNames::Button35); 213 | const FKey FDirectInputKeys::Button36(FDirectInputKeyNames::Button36); 214 | const FKey FDirectInputKeys::Button37(FDirectInputKeyNames::Button37); 215 | const FKey FDirectInputKeys::Button38(FDirectInputKeyNames::Button38); 216 | const FKey FDirectInputKeys::Button39(FDirectInputKeyNames::Button39); 217 | const FKey FDirectInputKeys::Button40(FDirectInputKeyNames::Button40); 218 | const FKey FDirectInputKeys::Button41(FDirectInputKeyNames::Button41); 219 | const FKey FDirectInputKeys::Button42(FDirectInputKeyNames::Button42); 220 | const FKey FDirectInputKeys::Button43(FDirectInputKeyNames::Button43); 221 | const FKey FDirectInputKeys::Button44(FDirectInputKeyNames::Button44); 222 | const FKey FDirectInputKeys::Button45(FDirectInputKeyNames::Button45); 223 | const FKey FDirectInputKeys::Button46(FDirectInputKeyNames::Button46); 224 | const FKey FDirectInputKeys::Button47(FDirectInputKeyNames::Button47); 225 | const FKey FDirectInputKeys::Button48(FDirectInputKeyNames::Button48); 226 | const FKey FDirectInputKeys::Button49(FDirectInputKeyNames::Button49); 227 | const FKey FDirectInputKeys::Button50(FDirectInputKeyNames::Button50); 228 | const FKey FDirectInputKeys::Button51(FDirectInputKeyNames::Button51); 229 | const FKey FDirectInputKeys::Button52(FDirectInputKeyNames::Button52); 230 | const FKey FDirectInputKeys::Button53(FDirectInputKeyNames::Button53); 231 | const FKey FDirectInputKeys::Button54(FDirectInputKeyNames::Button54); 232 | const FKey FDirectInputKeys::Button55(FDirectInputKeyNames::Button55); 233 | const FKey FDirectInputKeys::Button56(FDirectInputKeyNames::Button56); 234 | const FKey FDirectInputKeys::Button57(FDirectInputKeyNames::Button57); 235 | const FKey FDirectInputKeys::Button58(FDirectInputKeyNames::Button58); 236 | const FKey FDirectInputKeys::Button59(FDirectInputKeyNames::Button59); 237 | const FKey FDirectInputKeys::Button60(FDirectInputKeyNames::Button60); 238 | const FKey FDirectInputKeys::Button61(FDirectInputKeyNames::Button61); 239 | const FKey FDirectInputKeys::Button62(FDirectInputKeyNames::Button62); 240 | const FKey FDirectInputKeys::Button63(FDirectInputKeyNames::Button63); 241 | const FKey FDirectInputKeys::Button64(FDirectInputKeyNames::Button64); 242 | const FKey FDirectInputKeys::Button65(FDirectInputKeyNames::Button65); 243 | const FKey FDirectInputKeys::Button66(FDirectInputKeyNames::Button66); 244 | const FKey FDirectInputKeys::Button67(FDirectInputKeyNames::Button67); 245 | const FKey FDirectInputKeys::Button68(FDirectInputKeyNames::Button68); 246 | const FKey FDirectInputKeys::Button69(FDirectInputKeyNames::Button69); 247 | const FKey FDirectInputKeys::Button70(FDirectInputKeyNames::Button70); 248 | const FKey FDirectInputKeys::Button71(FDirectInputKeyNames::Button71); 249 | const FKey FDirectInputKeys::Button72(FDirectInputKeyNames::Button72); 250 | const FKey FDirectInputKeys::Button73(FDirectInputKeyNames::Button73); 251 | const FKey FDirectInputKeys::Button74(FDirectInputKeyNames::Button74); 252 | const FKey FDirectInputKeys::Button75(FDirectInputKeyNames::Button75); 253 | const FKey FDirectInputKeys::Button76(FDirectInputKeyNames::Button76); 254 | const FKey FDirectInputKeys::Button77(FDirectInputKeyNames::Button77); 255 | const FKey FDirectInputKeys::Button78(FDirectInputKeyNames::Button78); 256 | const FKey FDirectInputKeys::Button79(FDirectInputKeyNames::Button79); 257 | const FKey FDirectInputKeys::Button80(FDirectInputKeyNames::Button80); 258 | const FKey FDirectInputKeys::Button81(FDirectInputKeyNames::Button81); 259 | const FKey FDirectInputKeys::Button82(FDirectInputKeyNames::Button82); 260 | const FKey FDirectInputKeys::Button83(FDirectInputKeyNames::Button83); 261 | const FKey FDirectInputKeys::Button84(FDirectInputKeyNames::Button84); 262 | const FKey FDirectInputKeys::Button85(FDirectInputKeyNames::Button85); 263 | const FKey FDirectInputKeys::Button86(FDirectInputKeyNames::Button86); 264 | const FKey FDirectInputKeys::Button87(FDirectInputKeyNames::Button87); 265 | const FKey FDirectInputKeys::Button88(FDirectInputKeyNames::Button88); 266 | const FKey FDirectInputKeys::Button89(FDirectInputKeyNames::Button89); 267 | const FKey FDirectInputKeys::Button90(FDirectInputKeyNames::Button90); 268 | const FKey FDirectInputKeys::Button91(FDirectInputKeyNames::Button91); 269 | const FKey FDirectInputKeys::Button92(FDirectInputKeyNames::Button92); 270 | const FKey FDirectInputKeys::Button93(FDirectInputKeyNames::Button93); 271 | const FKey FDirectInputKeys::Button94(FDirectInputKeyNames::Button94); 272 | const FKey FDirectInputKeys::Button95(FDirectInputKeyNames::Button95); 273 | const FKey FDirectInputKeys::Button96(FDirectInputKeyNames::Button96); 274 | const FKey FDirectInputKeys::Button97(FDirectInputKeyNames::Button97); 275 | const FKey FDirectInputKeys::Button98(FDirectInputKeyNames::Button98); 276 | const FKey FDirectInputKeys::Button99(FDirectInputKeyNames::Button99); 277 | const FKey FDirectInputKeys::Button100(FDirectInputKeyNames::Button100); 278 | const FKey FDirectInputKeys::Button101(FDirectInputKeyNames::Button101); 279 | const FKey FDirectInputKeys::Button102(FDirectInputKeyNames::Button102); 280 | const FKey FDirectInputKeys::Button103(FDirectInputKeyNames::Button103); 281 | const FKey FDirectInputKeys::Button104(FDirectInputKeyNames::Button104); 282 | const FKey FDirectInputKeys::Button105(FDirectInputKeyNames::Button105); 283 | const FKey FDirectInputKeys::Button106(FDirectInputKeyNames::Button106); 284 | const FKey FDirectInputKeys::Button107(FDirectInputKeyNames::Button107); 285 | const FKey FDirectInputKeys::Button108(FDirectInputKeyNames::Button108); 286 | const FKey FDirectInputKeys::Button109(FDirectInputKeyNames::Button109); 287 | const FKey FDirectInputKeys::Button110(FDirectInputKeyNames::Button110); 288 | const FKey FDirectInputKeys::Button111(FDirectInputKeyNames::Button111); 289 | const FKey FDirectInputKeys::Button112(FDirectInputKeyNames::Button112); 290 | const FKey FDirectInputKeys::Button113(FDirectInputKeyNames::Button113); 291 | const FKey FDirectInputKeys::Button114(FDirectInputKeyNames::Button114); 292 | const FKey FDirectInputKeys::Button115(FDirectInputKeyNames::Button115); 293 | const FKey FDirectInputKeys::Button116(FDirectInputKeyNames::Button116); 294 | const FKey FDirectInputKeys::Button117(FDirectInputKeyNames::Button117); 295 | const FKey FDirectInputKeys::Button118(FDirectInputKeyNames::Button118); 296 | const FKey FDirectInputKeys::Button119(FDirectInputKeyNames::Button119); 297 | const FKey FDirectInputKeys::Button120(FDirectInputKeyNames::Button120); 298 | const FKey FDirectInputKeys::Button121(FDirectInputKeyNames::Button121); 299 | const FKey FDirectInputKeys::Button122(FDirectInputKeyNames::Button122); 300 | const FKey FDirectInputKeys::Button123(FDirectInputKeyNames::Button123); 301 | const FKey FDirectInputKeys::Button124(FDirectInputKeyNames::Button124); 302 | const FKey FDirectInputKeys::Button125(FDirectInputKeyNames::Button125); 303 | const FKey FDirectInputKeys::Button126(FDirectInputKeyNames::Button126); 304 | const FKey FDirectInputKeys::Button127(FDirectInputKeyNames::Button127); 305 | const FKey FDirectInputKeys::Button128(FDirectInputKeyNames::Button128); 306 | 307 | const FKey FDirectInputKeys::Pov1(FDirectInputKeyNames::Pov1); 308 | const FKey FDirectInputKeys::Pov2(FDirectInputKeyNames::Pov2); 309 | const FKey FDirectInputKeys::Pov3(FDirectInputKeyNames::Pov3); 310 | const FKey FDirectInputKeys::Pov4(FDirectInputKeyNames::Pov4); 311 | --------------------------------------------------------------------------------