Code Monkey home page Code Monkey logo

joystickplugin's People

Contributors

getnamo avatar ikarus76 avatar jaydenmaalouf avatar jvukovich avatar malikumane avatar sampersson avatar tsky1971 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

joystickplugin's Issues

Axis keeps firing

A while after connecting the controller Axis 5 or 4 (which are R2 and L2 on my controller) keep firing for no reason. disconnecting and connecting the controller back fixes it temporarily but after a while it starts getting triggered again. This also happens if I just press any of these 2 axis and when I let go, its still getting triggered every frame

Linker Error when upgrading to 5.3

I was attempting to upgrade my project to UE5.3, and I noticed several linker errors.

This happens on the JoystickLogManager and it is because the template functions there are implemented in CPP and not in the header file. By moving them all there, the errors disappear

Configuration validation on ForcedFeedbackEffect

The subclasses of ForcedFeedbackEffect need some check to validate the modified update won't throw errors within the SDL object

Need to look into a way to validate on an individual class basis

Enhanced Input User Settings does not persists runtime remappings from joysticks detected using this plugin.

Hi, @JaydenMaalouf!
Thanks for your plugin, it helps us immensely!

I'm creating this new issue as a follow-up of #48.
I've looked into #56 and unfortunately, it doesn't look like the same problem I'm having.

In my case all buttons and axis are working as intended with the Enhanced Input System, even with runtime remapings, but if I enable the Enhanced Input User Settings in order to save the runtime remappings, when I restart the game, only the keys from standard gamepads and keyboard and mouse are loaded back. Any remappings from joysticks detected using the Joystick Plugin are lost.

You can see a video about this feature here: https://www.youtube.com/watch?v=u9vJ3FBaasU

Any help will be much appreciated!

joystick values randomly doubling/tripling during runtime

image

it'll sometimes triple in the ui or non performance intensive scenes, so I think it's framerate based.

After a bit more testing, I think it happens when the game updates faster than the plugin, so it adds the same value twice or 3 times since the plugin hasn't had time to update. when the game's at a lower fps it works fine.

FJoystickInputDevice is missing JOYSTICKPLUGIN_API.

On 3.2.0-rc.10, the FJoystickInputDevice class is missing the JOYSTICKPLUGIN_API macro.

On my code I got a pointer to it through JoystickSubsystem->GetInputDevice() but when I called JoystickInputDevice->GetInstanceIdByKey(Key) I got the link error: Error LNK2019 : unresolved external symbol "public: struct FJoystickInstanceId __cdecl FJoystickInputDevice::GetInstanceIdByKey(struct FKey const &)const " (?GetInstanceIdByKey@FJoystickInputDevice@@QEBA?AUFJoystickInstanceId@@AEBUFKey@@@Z) referenced in function "private: bool __cdecl UCPKeyMappingSubsystem::GetKeyOwnerJoystickGuid(struct FKey const &,struct FGuid &)const " (?GetKeyOwnerJoystickGuid@UCPKeyMappingSubsystem@@AEBA_NAEBUFKey@@AEAUFGuid@@@Z)

After a lot of time banging my head on the wall, I found that this class was never exported on the plugin module.

Is it possible to work with multiple devices at the same time?

Good day! I am developing a racing game and looking for a plug-in to implement car driving. Please tell me, your plugin makes it possible to connect several devices to the game at the same time (steering wheel, pedals, gearbox, button box, handbrake, each device is connected to a PC simultaneously via USB). Is it possible to read the readings of axes and buttons at the same time, for example, steering wheel axis 1 (device 1) - steering wheel rotation axis, pedal axis 1 (device 2) - throttle axis, pedal axis 2 (device 2) - brake axis, button 10 of the button box (device 3) - view change, etc.? I am also interested in the question: will your plugin be able to support DIY gaming devices (for example, arduino button box, stm32 steering wheel, etc.)? And also (if possible) tell me if it is possible to communicate with you by email, and not here? If possible, please let us know your email.

Add Haptic Vibration

This obviously isn't supported by all joystick types but for those that do, integrate this with the existing implementation and allow it to be fed data from ForceFeedbackComponent (the UE built one).

Restructure the ForcedFeedbackEffect class

To make the base classes more specific to their data structures, we should make the base effect templated and let the compiler handle the heavy lifting.

As part of this, we should create data structures specific to each effect type. Potentially create a base struct if there is a lot of overlap.

JoystickDeviceManager initialized too late

Hey again @JaydenMaalouf,

Another bug came up today, this one leading to crash on startup. It's fairly easy to reproduce.

  • Open your startup map
  • Open your level blueprint
  • Add a call to JoystickCount connected to the BeginPlay
  • Start play in Standalone mode

This should lead to a crash. At least it does for me and a colleague. I've tracked down the issue to the fact is the JoystickDeviceManager doesn't yet exist at the time of the JoystickCount call. The manager actually takes a couple of seconds to spawn.

It's not an issue in-editor, or if your game/app doesn't use SDL right after launch. But it can become an issue in certain use cases (e.g. your default controller registers for SDL events).

However, I don't really know how to fix this. The manager is created by CreateInputDevice, which is inherited from IInputDeviceModule; so it's not like we can just call that earlier. I've tried changing the plugin's LoadingPhase, but it doesn't seem to impact this call. I don't really have any idea of the call chain leading up to CreateInputDevice being called, so I don't know why it occurs so late in the startup process.

For now the workaround is just to delay all calls to the plugin by a few seconds, which works, but isn't really robust (or nice). IJoystickPlugin::IsAvailable() could maybe check if the manager exists, but even though that would prevent crashes, it wouldn't solve everything as call made before availability would just get ignored, without the user even knowing it.

I can investigate this more, but I wanted to get it past you first.

Bertrand

Update the README

Need to demonstrate how to

Compile the plugin from source
Utilise Forced Feedback
Extend Effects

Linux Support

SDL2 does support Linux however, I haven't attempted to compile it yet.
Raising this so I don't forget

Joysticks don't work with InputKeySelector

Hey @JaydenMaalouf,

We recently discovered that joysticks (as defined in the plugin) don't properly work with the InputKeySelector widget.

image

This widget is mostly used to allow runtime rebinding, which is extremely useful for joysticks, as there's really no standard way to define axes (e.g. each vendor will give a different index to the "throttle" axis).

The behavior between joysticks and the widget is weird: if the plugin isn't enabled, the widget totally ignores the joystick, which is expected. If the plugin is enabled, the widget apparently can detect part of the joystick, since the widget will correctly toggle if you move an axis, but the related event (On Key Selected) doesn't fire.

I can't test this right now as I don't have a joystick, but I've been remotely debugging that with a colleague this morning. We currently have a workaround, so it's not a big issue. But it would be nice to have the ability to rebind joystick axes at runtime.

I could try to implement this myself, but seeing as you seem more at ease around this code than me, I prefer to open an issue first ;-)

SDL device name doesn't seem to appear properly on Linux, and double input registering happens with DualSense controllers.

Hi! I wanted to write about an issue that I'm currently facing with the plugin (at least with the sensor-implementation branch which supports UE5) where my DualSense controller appears under a generic joystick name titled "Joystick" (at least under Linux, I do not have a Windows install currently to test this on), and there's seemingly a double input related issue where the original controller device is not being hidden from Unreal. From what I've seen from other things using SDL2, they seemingly detect my controller type fine, which makes the issue a bit more strange.

Interestingly, even when I don't use the plugin, at least on Linux, my DualSense controller seems to behave similarly to an XInput controller, with a Platform and User Device ID of 0, so I don't know if there's anything inherently wrong with how Unreal handles input on Linux now, but I can at least confirm that I was able to recreate the issue using a Ubuntu Live USB to make sure that my Fedora KDE setup wasn't just weird:

image

I also wonder if there's any C++ or Blueprints related functionality for the plugin that allows you to grab the current controller type, such as in the case where you may want to run a check that changes controller prompt UI elements from say Xbox to PlayStation equivalents.

Difficulty mapping Thrustmaster

Greetings,

I'm attempting to use a TFlightHotasX with the plugin. While the plugin recognizes it in the Mapping Context as a "Joystick 0" for any button/axis, I would like to have the specific name of the device as I might have other joysticks connected to my project so I can easily distinguish between them.
image

I noticed in your Wiki on the Usage page that you indeed have different names showing up instead of just "Joystick 0" but I'm a bit confused on how this should be done.

These are my current project settings for the plugin:
image

Unlike in the Usage page, I do not have the option to select the key value.

Thank you

Memory management on native classes

Previous author didn't implement any reference cleanups on destroy which means we have memory we haven't cleared up.

This isn't an issue with our UObjects as UE will GC for us but our SDL implementations have no cleanup right now.

Create custom K2 node

To properly support CreateEffect, we should create a custom K2 node that handles auto casting.

Massive problem regarding steering wheel device index's

When disconnecting a steering wheel and plugging it back in instead of it binding to "joystick0" It will keep "joystick0" but also add "joystick1" and it will only send axis and button events to the newly created joystick1, and again if i plug out and back in again it will make a "joystick2" and do the same thing again.

Device configuration lost if device is not connected

If I disconnect the device I configured, the Events do not appear on Editor Restart.

With Connected Device and Configuration set:

image

But if I disconnect the device, this happens:

image

With warning being:
"InputAxisKey Event specifies invalid FKey'Joystick_TFlightHotasX_0_Axis0' for Joystick_TFlightHotasX_0_Axis0"

And if I search any input Event, they do not come up

image.

It seems the events depend on whether there's a configuration AND if the device is connected, but we don't want to be dependant on the device being connected or not. Plus, we have an array of Joysticks to use and configure and we can't have all of them connected at the same time.

I tried to replicate with two joysticks at the same time and the same happens: while both configured and connected, they work, but if I disconnect one of them, its events disappear

Joystick Axis and Buttons not working

I'm able to assign the joystick in the enhanced input mapper, but I can't choose a specific event. When I choose one, it only shows the device name and the event never fires.
image
I'm using UE5.3 and release 3.2 (the experimental one because of the 5.3 build)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.