I have the plug in installed, and input mapping appear in engine-input (I am using Thrustmaster HOTAS X)
I have tried adding in pawn and level (add register for joystick events etc) but i get nothing. In mappings it states the buttons when selecting, but once selected they all say joystick T if that makes any difference.
Even in the test projects, The plug in shows up, but my HOTAS is not doing anything. The control panel shows its working but nothing in U4 editor or packaged game.
Hi, I know it’s an old question, but I’m would also like to implement forcefeedback(DirectX DirectInput for old MS FFB2 Joystick ForceFeedback Effects.
Unfortunately it seems, that SDL 2.0 removed the DirectInput FF implementation. Did you make any Progress on this?
I have the joystick all working great in game. The only problem I am getting is using a button with UMG. I am using the basic onclicked event and also tried the on pressed event. These are working fine for the controller, but how do i make a joystick button work with it?
I have tried the keyup and keydown, but these dont work either, they work fine for controller.
First issue is known : dots in device name break it. The fix mentioned earlier works but the repo doesn’t have it.
Second issue is initialization. If you have a thrust level on the joystick and leave it in a non-zero position, for example, axis input in the game will be zero until you move. Then the actual value will be sent.
but i couldn’t find the “Joystick” anywhere.
When i open Input mapping viewClass AddComponent,i can’t search “Joystick”,just like this:
![O5Y4Z0HYFG2}TQJE19$N8K.png|676x591
Anyway other people’s editor have the joystick which i find in forum ,just like this:
![]L~0BI)JIB}]L4P]%1_799.png|480x298
Anyone using this plugin with 4.16 will have to update the plugin’s build.cs:
namespace UnrealBuildTool.Rules
{
using System;
using System.IO;
using System.Collections.Generic;
public class JoystickPlugin : ModuleRules
{
// UE does not copy third party dlls to the output directory automatically.
// Link statically so you don't have to do it manually.
private bool LinkThirdPartyStaticallyOnWindows = true;
private string ModulePath
{
get { return ModuleDirectory; }
}
private string ThirdPartyPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
}
private string BinariesPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "../../Binaries/")); }
}
public virtual void SetupBinaries(
TargetInfo Target,
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
ref List<string> OutExtraModuleNames
)
{
//OutBuildBinaryConfigurations.Add(
//new UEBuildBinaryConfiguration(UEBuildBinaryType.DynamicLinkLibrary, InTargetName: "SDL2.dll"));
}
public JoystickPlugin(ReadOnlyTargetRules Target) : base(Target)
{
PublicDependencyModuleNames.AddRange(
new string]
{
"Core",
"CoreUObject",
"Engine",
"InputCore",
"Slate",
"SlateCore",
// ... add other public dependencies that you statically link with here ...
});
PrivateIncludePathModuleNames.AddRange(
new string]
{
"InputDevice",
});
if (Target.Type == TargetRules.TargetType.Editor)
{
PrivateIncludePathModuleNames.AddRange(
new string]
{
"PropertyEditor",
"ActorPickerMode",
"DetailCustomizations",
});
PrivateDependencyModuleNames.AddRange(
new string]
{
"PropertyEditor",
"DetailCustomizations",
// ... add private dependencies that you statically link with here ...
});
}
DynamicallyLoadedModuleNames.AddRange(
new string]
{
// ... add any modules that your module loads dynamically here ...
});
if (UEBuildConfiguration.bBuildEditor == true)
{
LinkThirdPartyStaticallyOnWindows = false;
}
if (Target.Platform == UnrealTargetPlatform.Win64)
{
string SDL2Path = ThirdPartyPath + "SDL2/SDL/";
string SDL2LibPath = SDL2Path + "Lib/";
PublicIncludePaths.Add(Path.Combine(SDL2Path, "include/"));
PrivateIncludePaths.Add(Path.Combine(SDL2Path, "include/")); // Public || Private !? is there documentation ?
if (LinkThirdPartyStaticallyOnWindows) {
PublicAdditionalLibraries.Add(Path.Combine(SDL2LibPath, "SDL2-static.lib"));
PublicAdditionalLibraries.Add(Path.Combine(SDL2LibPath, "SDL2main.lib"));
} else
{
PublicAdditionalLibraries.Add(Path.Combine(SDL2LibPath, "SDL2.lib"));
}
PublicAdditionalLibraries.Add("Version.lib");
}
if (Target.Platform == UnrealTargetPlatform.Win32)
{
string SDL2Path = ThirdPartyPath + "SDL2/SDL/";
string SDL2LibPath = SDL2Path + "Lib32/";
PublicIncludePaths.Add(Path.Combine(SDL2Path, "include/"));
if (LinkThirdPartyStaticallyOnWindows)
{
PublicAdditionalLibraries.Add(Path.Combine(SDL2LibPath, "SDL2-static.lib"));
PublicAdditionalLibraries.Add(Path.Combine(SDL2LibPath, "SDL2main.lib"));
}
else
{
PublicAdditionalLibraries.Add(Path.Combine(SDL2LibPath, "SDL2.lib"));
}
PublicAdditionalLibraries.Add("Version.lib");
}
else if (Target.Platform == UnrealTargetPlatform.Mac)
{
PublicFrameworks.Add("/Library/Frameworks/SDL2.framework");
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
{
//AddThirdPartyPrivateStaticDependencies(Target, "SDL2");
AddEngineThirdPartyPrivateStaticDependencies(Target, new string]{"SDL2"});
}
}
}
}
Notably, Target is now of type ReadOnlyTargetRules and AddEngineThirdPartyPrivateStaticDependencies now takes a ReadOnlyTargetRules and a string array.
Not sure if anyone is still following this thread -I personally find the official RawInput plugin to be unusable with all its issues and prefer to use this one.
I discovered that some of our players had issues with Thrustmaster T.A.R.G.E.T emulation software, which would join several devices into one virtual device, and for some devices create names with special characters that are used in Unreal’s Input.ini / GameUserSettings.ini file formats.
Therefore, I would recommend that, apart from dots, you also strip out any special chars used by this format, or just limit device / product names to A-Za-Z0-9 plus ’ ', - and _.