matf
New Member
Posts: 7
|
Post by matf on Dec 4, 2020 2:24:03 GMT
Hi,
I am working on a custom throttle device with some extra buttons, knobs and rockers (with someone who knows how to build it) and this throttle will have a rotary rocker with 6 fixed, independent and mutually exclusive positions:
Each position will send a different input. I would need to map them this way in my flight simulator (not sure about ARMED yet, but it should not be a problem because it's a single input for a single action):
As you can see, the problem is I would need to somehow bind together the 4 remaining positions as fixed values of a same axis (i.e., rank them so that the simulator knows that 25 is lower than 50, which is lower than 75, which is lower than UP, and then emulate an axis out of this). It is not a problem if my axis has only 4 fixed values, I don't need it to be continuous. I cannot map those 4 rocker positions independently because as you can see, there is no option in the flight simulator settings to map fixed spoilers values, as opposed to flaps for example.
Those flaps settings would be exactly what I need, but I need to find another way with spoilers, and a "fake" axis is the only way I see.
Does anyone know if vjoy can allow me doing that, and if so how should I proceed? Thank you very much.
|
|
|
Post by Shaul (Admin) on Dec 4, 2020 6:57:32 GMT
I always find it hard to get into someone else's design so forgive me if I am totally out of tune. Here is what I understand: - You design a hardware device.
- Your hardware must include a 6-way switch.
- Four of the the six represent discrete scalar values (25-50-75-100).
- You want to map these values to a vJoy control.
I assume you connect this HW device to the computer. (USB? Bluetooth?) How does this device is identified? as a HID? ad multiple HIDs?
Anyway, you must write a feeder to feed vJoy. Correct? In the feeder, you will have to feed these values into an HID control of the vJoy device (Button, Axis, POV). You can do one of the following: - Assign the values to a descrete POV. It has 4 positions. Problem: These positions are hard coded AFAIR as 0-3.
- Assign the values to a continuous POV. It supports values from 0 to 35999. Use only those you need.
- Assign the values to one of the 8 axes.
I must confess that it has been over 10 years since I wrote the code, so I may be totally wrong. If you still have questions don't hesitate. I will look into the code in hope I can still understand my own code.
|
|
matf
New Member
Posts: 7
|
Post by matf on Dec 4, 2020 9:47:25 GMT
I always find it hard to get into someone else's design so forgive me if I am totally out of tune. Here is what I understand: - You design a hardware device.
- Your hardware must include a 6-way switch.
- Four of the the six represent discrete scalar values (25-50-75-100).
- You want to map these values to a vJoy control.
I assume you connect this HW device to the computer. (USB? Bluetooth?) How does this device is identified? as a HID? ad multiple HIDs?
Anyway, you must write a feeder to feed vJoy. Correct? In the feeder, you will have to feed these values into an HID control of the vJoy device (Button, Axis, POV). You can do one of the following: - Assign the values to a descrete POV. It has 4 positions. Problem: These positions are hard coded AFAIR as 0-3.
- Assign the values to a continuous POV. It supports values from 0 to 35999. Use only those you need.
- Assign the values to one of the 8 axes.
I must confess that it has been over 10 years since I wrote the code, so I may be totally wrong. If you still have questions don't hesitate. I will look into the code in hope I can still understand my own code.
Thank you for your fast answer, Shaul.
I totally understand that it is difficult to get into someone else's custom design, that is why I tried to illustrate with the 6-way switch and show the mapping menus in the simulator. You understood correctly.
In theory, two of the positions (DOWN and ARMED) could be on a separate toggle switch, and then a real axis could replace 25-50-75-UP, but there are space constraints and the manufacturer is using a USB controller that is limited to 8 axis total. I didn't show a full picture, but there are already 8 axes somewhere else on the device. The 6-way switch therefore seemed like a good solution to me, but due to the limitations of the mapping menu in my flight simulator (i.e., no entries to map fixed spoiler values like flaps have with Flaps 1, Flaps 2, Flaps 3 and Flaps 4), the 25-50-75-UP values can only be mapped if they are recognized as part of an axis. There is no 0, but theoretically moving the switch to ARMED or to DOWN should equate 0.
I am no expert on how the device will work software-wise, but they connect through USB and you can have a look at the short videos from the manufacturer where he shows how they are recognized in Windows' joystick menu: www.youtube.com/watch?v=n1MAriKQ5xA
My device won't be exactly the same, but the controller should be the same. It is limited to 8 axes, 16 toggles, 64 buttons (I believe the 6-way switch counts as 6 buttons).
I am not familiar with vJoy yet, I stumbled upon it when looking for a software solution for my issue. Therefore I don't exactly know what writing a feeder means. What I know is the device will already be ready to use when delivered, like the video above illustrates, but I will certainly need a third-party tool for my specific issue above between Windows and the flight simulator. The manufacturer told me he cannot/doesn't know how to do what I want out of the box when he programs the device, but that third party tools could perhaps help. This means I believe the device will work without vJoy, but this specific 6-way switch won't do what I want.
|
|
matf
New Member
Posts: 7
|
Post by matf on Dec 4, 2020 12:53:09 GMT
The person who builds the device confirmed that the device will be seen as one USB device in Windows. He is using the MJoy16 controller:
|
|
|
Post by Shaul (Admin) on Dec 4, 2020 13:22:30 GMT
I believe I now understand the situation better.
You are creating a HW device and count on a SW provider for the firmware. From the limitations you mention (8 axes, 64 switches) I deduce that he implements your HW as a single HID. In this case, you do not need vJoy. You can ask him to implement the rotary switch as a POV button. If the implementation is not HID or more than a single HID device then vJoy may be useful after all.
|
|
|
Post by Shaul (Admin) on Dec 4, 2020 13:25:47 GMT
Your provider call POV as HAT switch, Use it.
|
|
matf
New Member
Posts: 7
|
Post by matf on Dec 4, 2020 13:34:30 GMT
So if the rotary switch is implemented as a POV/HAT, I will be able to map 25 - 50 - 75 and UP as scalar values in the simulator's "Spoiler axis"?
I will ask him, thank you very much. Should the 6 positions of the switch be implemented as POV, or only the 25 - 50 - 75 - 100? POV is the same as HAT, it's just the MJoy16 description that uses HAT as wording, correct?
[Edit] Unfortunately, this may not be possible:
"The SPD BRK switch has 6 contacts, and the XAT has 4 contacts. intermediate positions for XAT are created programmatically when adjacent contacts are closed. Connection is not possible."
Also, he was planning on using the HAT connections for another button already. So back to trying to find a software solution using vJoy (or other) to bind 4 independent inputs together as fixed values of a single axis.
|
|
|
Post by Shaul (Admin) on Dec 4, 2020 20:42:37 GMT
POV and HAT are different names to the same thing. Your guy is practically implementing a vJoy device in Hardware. I think that the limitations you describe (Single HAT). By definition, an HID may consist of up to 4 HAT/POV controls.
If these limitations persist, you might just use vJoy fix them. BTW, if I am not mistaken the board docs said somewhere that it supports more than one device. If so, you can split your HW between two devices and use vJoy to merge them back a single device. Just a thought.
|
|
matf
New Member
Posts: 7
|
Post by matf on Dec 5, 2020 0:15:26 GMT
The unit has entered production, so I think I will indeed have to use vJoy to make this 6-way switch do what I want in software.
Someone on another forum told me that it should be possible to combine vJoy and Joystick Gremlin to make one button behave as a given position in an axis. So in theory, I could bind "Spoiler axis" in the flight simulator as a vJoy axis, which is exactly what I had in mind when I customized the throttle, but was not sure vJoy could do it. He said the simplest would perhaps be to use Joystick Gremlin for all controller actions, so that everything can be bound with vJoy in the flight simulator, and modifications can be done only in JG (I didn't quite understand what he meant in this sentence).
If this is confirmed to be possible in vJoy, then my problem is almost solved. Almost, because I have yet to figure out how to actually set this up!
|
|
|
Post by Shaul (Admin) on Dec 5, 2020 8:06:59 GMT
Took a look at Joystick Gremlin. Yes, it seems to do the job. Good luck. Next version of your product, I recommend implementing the entire software in box. This will render JG and vJoy unneeded. You will basically need to tweek the HID descriptors that you already have on your board (And you probably weren't aware of).
|
|
matf
New Member
Posts: 7
|
Post by matf on Dec 6, 2020 22:41:27 GMT
Given the cost of that one unit, not sure there'll ever been a next version, I hope this one will have a long life! I agree it would have been much better to have something working the way I wanted out of the box, and plug and play. Unfortunately I don't really know how this could have been done since the builder replied the options we considered wouldn't work (namely that plugging a 6-way switch to HAT is not possible because the switch has too many contacts for the HAT).
|
|
|
Post by Shaul (Admin) on Dec 7, 2020 5:33:46 GMT
I see. If you have access to the firmware you might fix it post factum. It is all in the HID descriptor.
|
|
matf
New Member
Posts: 7
|
Post by matf on Jan 24, 2021 3:02:39 GMT
|
|