Download

POV hat for T.flight hotas?

I’ve gotten everything on my Hotas to work … except the POV hat. I tried ‘showdebug input’ while in play, and that showed every other control as I pressed them, just not the POV hat.

Does anyone know how to make that hat work? Or can someone point me to a resource somewhere with the information I need?

Thanks

Does that help?

If not you have to go native with c++ (maybe even BP on player controller) and map out what the hat buttons are.

Theoretically just overwriting onkeydown and doing a printstring of the key name should get you the values you want.

However if you cannot select what is printed out within the Input options of project settings you have to manually set up what they do from the key down override.

You check that they match what they should, and you call an event manually for them.

Would perhaps be better to directly start by tying the events to a BPinterface you can then just implement elsewhere without too much of a problem.

At that point from the override of key down you check that the controlled pawn implements your interface and you send the interface call if it does.

Always return at the end or you essentially “consume” all inputs.

You can find full on tutorials showcasing how to do this when implementing gamepad into the UMG stuff.
It’s the same theory, just done on the controller instead of inside UMG.

Thanks for the response.

I had found the link you provided before creating the post. It’s from 2014 and the link in it no longer works. There is, however, a plugin that does work called “WM Input Manager.” It has functionality for the POV hat, but it’s a total pain in the ■■■ to set up. I don’t want to use it.

I was hoping to do it from the “Windows RawInput” plugin from Epic as it’s small and easy instead of the 3rd party “WM Input Manager” plugin which is bulky and VERY hard to set up.

I don’t know what “key down override” or “onkeydown” are. They don’t seem to be functions in UE, but I’ll look into that and see if that will help.

I’ve tried the “IsInputKeyDown” function, but that didn’t help. It has to be set up with the specific input or “AnyKey.” (If I knew the specific input, I wouldn’t be here asking for help :slight_smile:.) And “AnyKey” doesn’t work because it goes ‘true’ immediately and stays ‘true’. I think this is because the axis values are never exactly zero. They always end up being something like 0.000236 or whatever.

I can disable all the axis inputs and then it works fine, but the POV doesn’t cause a hit. I read somewhere that the POV used an axis input, so disabling the axis will also disable the POV. But I have tested the three remaining axis that show up in the RawInput and the values do not change when I hit the POV, so I’m pretty well lost on this one.

example:

currentPlayerController->WasInputKeyJustPressed(EKeys::E)

OnKeyDown is really only relevant for UMG overrides - but you can totally use it to find out what the EKeys values of the hat are supposed to be called…
Just set up umg and override the input.
something like

How do I get the results of that to display to the screen? I can’t bind it to a text box.

I would think that the print string would do that, but it’s not printing anything. The widget is loaded and working though. Just the result of the onkeydown isn’t showing up.

If it works for keyboard the problem is that Unreal doesn’t know what input the hardware is sending.

The options become to either add a layer and get the gamepad to simulate a different key via software for the gamepad (think of it as Logitech G keys using some keyboard key when pressed).

Try RawInput Plugin | Unreal Engine Documentation

Or dive into scripting a c++ library for the specific piece of hardware (And hardware interface).

Are you sure the drivers for the thing are up to date? It could literally just be due to that.
Or a lack of directx support for it.
Easy to check too. What is the specific brand/model?

The RawInput plugin is what I’m using. It’s called “Windows RawInput” in the plugin list. That’s the one the link you provided is talking about.

It doesn’t work for the keyboard. I set up the onkeydown exactly as it is shown in the picture you provided and it appears to do nothing. Nothing is printed to the screen when I press the mouse, a keyboard key, or a joystick button. I know the widget is loading though, because I put a generic text box on it just to test it. The text box is there, just the result of the print string from the override OnKeyDown isn’t.

I even tried just getting it to print Hello. Putting only a print string in the OnKeyDown function that printed Hello. It doesn’t. I don’t know how to get what is in the OnKeyDown to the screen.

Might just have to do with focus.

Make sure you set the focus to UI or game and UI like you would normally when popping up a menu.

Tried that already. Set input mode to “game and ui” … nothing. Then tried “UI only” … still nothing. I even added a breakpoint to the OnKeyDown starting node. It’s not getting called. I think the widget doesn’t have focus, and I don’t know how to do that beyond the UI Only setting, but it must have focus because my controls no longer function and there’s nothing else that could have focus. So, I don’t know.

Try focusing the widget manually (click into the input or tab to it).
Or add a focus in blueprint to it.

I put a button on the widget. It has no functionality, but it highlights when the I mouse over it, so the widget does have focus.

Update: OnPreviewKeyDown worked just fine … unfortunately nothing showed up when I pressed the POV hat. All the buttons on the Hotas showed up, just not the axis or the hat.

So that didn’t work, but it was worth a try. Thanks.

1 Like