WhiteMagic / JoystickGremlin

A tool for configuring and managing joystick devices.
http://whitemagic.github.io/JoystickGremlin/
GNU General Public License v3.0
313 stars 46 forks source link

Switches with Multiple States (ex:5 mode dial) show the wrong button order after being actuated quickly #385

Open sunnybouorm opened 2 years ago

sunnybouorm commented 2 years ago

Quick disclaimer, I am not sure whether this is a Virpil related configuration issue or a bug.

If I actuate a switch quickly for any 3+ state switch the input goes out of phase and does not match the actual button.

For example assume I am using a 5 mode dial (all states set to "normal" mode in Virpil), assume the input initially works as expected. left is what the actual button is, right is what joystick gremlin is displaying: M1=M1, M2=M2, M3=M3, M4=M4

Now turn the mode selector switch quickly (its not even really that fast It is even shifting in normal operation for me), the inputs shown for the same switch position shift in joystick gremlin, example: M1=M4, M2=M1, M3=M2, M4=M3

In VPC configuration tool the buttons are unchanged, each mode state is set to normal so only the mode the dial is on will be in the ON state every other dial state would be OFF (buttons 32 to 36): image

you can see the issue here, I rotated the dial quickly and now it shows Button 34 correctly in VPC however it shows button 32 in gremlin image

Here's were it gets more weird, the input viewer tool in joystick gremlin is always correct however the button highlighted and the action performed in the game is for the wrong button (doesn't match what input viewer is saying but what is highlighted), I gave the dial the good ol spin again and landed on 34 the value shifted again in gremlin to button 35 image

Now if I change in Virpil all the switches in the mode selector dial from "normal" to "inverted" the states can still shift in gremlin if actuated quickly however it corrects itself in gremlin and returns back to the correct order (for inverted mode in VPC firmware the switch the dial is pointed to is OFF, all other switch states are ON).

Software version: Joystick gremlin version release 13.3

system log.txt user log.txt

Hardware:

ohommes commented 2 years ago

I see these exact same issues; The input viewer always shows the correct button presses but Joystick Gremlin seems to have a Gremlin and switches states.

tachoid commented 2 years ago

Me too regarding the mode dial using Sharka-50 Panel. Moving inputs quickly typically results in the wrong Mode being selected. The workaround of changing modes slowly is fine for me, but even changing slowly from e.g. Mode 1 to Mode 2 sometimes 'sticks' on Mode 1, requiring another change back and forth to fix it - occasionally two changes.

WhiteMagic commented 2 years ago

If I'm interpreting the things here correctly this is purely the visual aspect of which input is highlighted in the UI? If so that's likely due to some code making sure the UI doesn't change too fast, though given none of that code will exist in the future and is of cosmetic nature this isn't something I'm going to track down.

sunnybouorm commented 2 years ago

If I'm interpreting the things here correctly this is purely the visual aspect of which input is highlighted in the UI? If so that's likely due to some code making sure the UI doesn't change too fast, though given none of that code will exist in the future and is of cosmetic nature this isn't something I'm going to track down.

Hi @WhiteMagic it is not cosmetic, the buttons actually activate macros and bound inputs from joystick gremlin.

I had this issue not only with the dial but the 3 state landing gear lever on a virpil control panel #2. In virpil control panel I can see the inputs working as expected however in joystick gremlin it both shows different inputs from the real deal and activates macros associated with the wrong inputs displayed even when the physical inputs are toggled at relatively normal human speeds.

tachoid commented 2 years ago

Yes, I confirm, it is not cosmetic - or there might be a cosmetic component but there is also a functional component.

The 5-way mode dial on my Virpil control panel is set to switch modes in JG. Mode 1 on the dial = Mode 1 in JG and so on.

Moving the dial slowly typically works fine - if I move to Mode 2 on the dial, then JG changes to Mode 2 and all the buttons etc. operate as per JG Mode 2. If I want to move from Mode 1 to Mode 5, I need to step through each mode in turn with say, a 0.5 second pause between modes. Otherwise I see the behaviour outlined below.

Moving the dial quickly often results in the dial being 'out of whack' with JG, e.g. if I move quickly from Mode 1 to Mode 5, JG will still be in Mode 1, even though the mode dial is at Mode 5.

I haven't tested whether JG is seeing all the button presses from the mode dial moves if I move the dial quickly. I guess that would be an obvious thing - maybe the Virpil unit is not sending all the button presses if the dial is moved quickly?

WhiteMagic commented 2 years ago

The visual assumption was due to the mention of the UI part, which would be that. However, if it does odd things regarding actions that's a different issue. The input viewer should be a valid test of what Gremlin sees, as it's been designed such that it will show any input it receives independently of how short/long the activation is. It will "show" a button as active for a minimum amount of time to make sure it's visible. If the input viewer doesn't see the sequence then either they aren't actually communicated properly via DirectInput or the input library is having trouble.

ohommes commented 2 years ago

It might be only cosmetic if I don't map the button to any action and let the "actual" application deal with it. But where I have mappings in place it activates sometimes the wrong action. Also many times the ALT key when part of an action becomes stuck and hence afterwards actions are strange. I try to avoid ALT + key or even SHIFT + key bindings since it seems to not always work due to these keys becoming stick or in a pressed state. When I notice this I need to hit the ALT key a few time to get out of that state. Not sure what is causing that but avoiding ALT and SHIFT seems the best

WhiteMagic commented 2 years ago

The stuck keys would be a different issue. A normal macro or map to keyboard will not cause this. However, you can create situations, especially with mode switches, where keys will be held down.