Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: The ability to pick which input device has the primary POV hat #41

Open
krota opened this issue May 17, 2021 · 7 comments
Open

Comments

@krota
Copy link

krota commented May 17, 2021

I have a bit of an edge case because my main stick is a "Frankenstick" of a Sidewinder FFB2 base with a Thrustmaster F-22 stick (with Cougar hats) grafted on to it. It has two separate USB outputs, one for the stick and one for the base, and appears as two devices. As such, my actual stick doesn't have any axes and can't be assigned as the device with the primary POV hat. I want to have trim bound to the trim hat on the stick (which is its POV hat) but my Warthog throttle is being picked up as the device with the primary POV hat.

Would it be possible to add a dropdown to select the device with the primary POV hat? I know this is a bit of an edge case, but may actually simplify the logic here if implemented:

if (((InGameAxAssgn)MainWindow.inGameAxis["Roll"]).GetDeviceNumber() == joynum || ((InGameAxAssgn)MainWindow.inGameAxis["Throttle"]).GetDeviceNumber() == joynum)

Thank you. This tool fixed all of my past issues with BMS resetting my controller order and has allowed me to actually enjoy the game again!

@Hawkeye4040
Copy link
Contributor

There may be other ways to fix this issue without this particular modification to the Alternate Launcher. I have a somewhat similar configuration with the Thrustmaster T16000M and TWCS throttle. I was having issues with the POV hat on TWCS being read, the solution I found allowed me to use more than one POV hat.

This is definitely the way to go here ideally because if this one little change is made here to the launcher for this edge case it will almost certainly cause various issues in other places. I may be able to help you get that working. The first thing I was curious about here is why the need for a device being assigned as the primary POV hat carrier? If both POV hats are able to be mapped that would be a satisfactory resolution right? Just to be explicitly clear before I do some digging.

@krota
Copy link
Author

krota commented May 18, 2021

I'm totally willing to look into a workaround!

I pulled the current code last night and was messing with it to see if I could add this feature myself. Not being super familiar with WPF applications though, I haven't had much success yet other than laying out the visual aspects and breakpointing through to see what information is available and where. I took the ignorant approach of simply removing the check for the device that either is mapped to roll or throttle and was able to map the hat in the launcher but it wasn't recognized once in game.

That brings me to my main question which might explain why this was implemented this way in the launcher:

Is this limitation enforced in the launcher that the primary POV hat has to be on the device that has the roll or throttle axis actually a limitation inside of BMS/Falcon 4 that the launcher is adhering to? If that's the case, I'll never be able to use the POV hat on my stick because it doesn't have any axes assigned to it. If allowing the use of 2 POV hats can get around this limitation, I'd be perfectly fine with that as a fix. Do you happen to have a link to where I can read up on that?

Thank you!

@Hawkeye4040
Copy link
Contributor

Well if it turns out we do need to add support for this I'll certainly be able to help with everything but especially the WPF specific part of it. I have us covered there. Chihirobelmo is very good at WPF too (obviously).

If you're on Discord we may have to talk on there a little bit where we could screen share or something sometime. I don't have a link it's something I did myself. I'm going through the input code now trying to see if that property actually is enforced. I haven't seen anything yet on that.

@krota
Copy link
Author

krota commented May 20, 2021

Yep, I'm on Discord. Is there a channel you guys collaborate in or should I reach out directly?

By the way, I decided to take a look at the thread for this project on the BMS forums and found a guy with another "Frankenstick" with the same issue I'm having and he was able to solve it by doing some manual mapping in his key file.

Here's his post and the ones that follow explain how to set the primary POV hat manually:
https://www.benchmarksims.org/forum/showthread.php?31774-Falcon-BMS-Alternative-Launcher-(Easy-Setup-Keep-Joystick-Assignments)&p=573327&viewfull=1#post573327

What stands out to me the most is this in the "Falcon BMS 4.35\User\Config\falcon bms.cfg" file:
set g_nNumOfPOVs 1
set g_nPOV1DeviceID 3 // this will depend on order of rows in your DeviceSorting.txt file, see sec 10.8.3

That seems to be the config setting supported by the key mapping to assign the primary POV hat to another controller. My biggest issue with BMS in the past is that it would always forget or reorder my joystick configs when I'd go to play it which would always result in having to make a bunch of changes and never really being able to pick up and play. The launcher has fixed that for me and this would be a very nice feature to ensure that I can still use the control mapping feature with my setup.

I'm going to do some manual testing with this tonight and let you know if it works.

@krota
Copy link
Author

krota commented May 22, 2021

Alright, I got this working by manually tweaking it according to that thread. Here's what had to be done:

In falcon bms.cfg I had to set the g_nPOV1DeviceID value to the correct stick in the DeviceSorting.txt file. In this case, it was stick 3 for me. My stick only has one POV hat, so I set g_nPOV1ID 0 to pick the first hat.

In my keyfile, I manually mapped the trim hat to trim with the following:

AFElevatorTrimDown 0 -1 -3 0 0x0 0
SimDoNothing 2 -1 -3 0 0x0 0
SimDoNothing 0 -1 -3 1 0x0 0
SimDoNothing 2 -1 -3 1 0x0 0
AFAileronTrimRight 0 -1 -3 2 0x0 0
SimDoNothing 2 -1 -3 2 0x0 0
SimDoNothing 0 -1 -3 3 0x0 0
SimDoNothing 2 -1 -3 3 0x0 0
AFElevatorTrimUp 0 -1 -3 4 0x0 0
SimDoNothing 2 -1 -3 4 0x0 0
SimDoNothing 0 -1 -3 5 0x0 0
SimDoNothing 2 -1 -3 5 0x0 0
AFAileronTrimLeft 0 -1 -3 6 0x0 0
SimDoNothing 2 -1 -3 6 0x0 0
SimDoNothing 0 -1 -3 7 0x0 0
SimDoNothing 2 -1 -3 7 0x0 0

So ultimately, it seems that this could be implemented into the launcher by allowing the user to choose which POV hat is assigned as POV1 and which is assigned as POV2 and writing that to the falcon bms.cfg file. With this config, I'm now able to use my POV hat on my stick for trim and also use my POV hat on my throttle to control radar elevation.

@Hawkeye4040
Copy link
Contributor

Now this was very helpful. I'll bring this up with him on Discord. We just DM on there.

This should be able to be implemented in the near future.

@Hawkeye4040
Copy link
Contributor

I don't have the time to implement this at this time though. I don't know about @chihirobelmo you'd have to ask him. We should also ask him where to put the UI controls. Off the top of my head I think we'd just need a drop down that is programmatically filled from a method that gets active joysticks that have POV hats.

I'm sure I'll be able to eventually but it might be a few weeks. I'm busy with work at the moment, it's crazy right now. I still have time to look over stuff though or help you if you want to try to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants