fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

Bug: Joystick and Mouse Buttons Don't Work with Every Control

Open Svedalrain opened this issue 4 years ago • 3 comments

I believed in #2844 that scrolling the mouse wheel never had an effect in game. It appears that it does even before #2845, and I jumped to the conclusion that because I didn't remember it working, it didn't work at all. My apologies.

When bound to Fire Primary Weapons, any movement of the wheel in the bound direction will cause primary weapons to fire (subject to having energy and fire wait and all that). This makes sense to me. Fire Secondaries also works, as does adjusting view distance in third person.

When bound to Pitch Up and Pitch Down, the amount that the wheel moves is reflected in the amount that the player ship changes pitch. This makes sense. Scrolling the wheel can also be used for yaw and bank well.

When bound to Afterburner, scrolling the wheel at any speed results in setting the ship's target velocity being set to max, but this is not accompanied by any of the other effects of afterburner: engine energy doesn't drain, the screen doesn't shake, and max velocity isn't increased. This only lasts for as long as the wheel is moving fast enough. Admittedly, the scroll wheel is not the best binding for Afterburner, but I was curious.

When bound to Increase Throttle 5 Percent, Decrease Throttle 5 Percent, or the four Set Throttle To [Zero, 1/3, 2/3, Max], scrolling the wheel at any speed produces no effect, which is what prompted #2844. The same is true for all the targeting commands, opening the comms menu, launching countermeasures, or changing primary or secondary weapons.

I've tried these on both the Oct 30 nightly and the Oct 29 nightly.

I don't presently have access to another mouse with a scroll wheel to see if this is just my mouse misbehaving.

Svedalrain avatar Oct 30 '20 12:10 Svedalrain

Ok, so the scroll wheel directions effectively act as a momentary button. So try your tests again by assigning them to a key or button and activate them as briefly as you can and see if you get similar results.

Also, please check that your mousewheel hardware is able to activate by a single increment. Mine, for example, has a tendency to get lazy and I have spin it around back and forth before it'll sense the single increment reliably.

z64555 avatar Oct 30 '20 13:10 z64555

I can't replicate the afterburner behaviour on any key but scrolling up or down.

When I bind firing weapons, one scroll increment equals one burst.

Svedalrain avatar Oct 30 '20 13:10 Svedalrain

Ok, so this issue runs deeper than what an client may think. Mouse buttons (and wheels) are essentially treated as joystick buttons, and have all of the restrictions and bugs that come with them.

The biggest of these is the fact that the joystick buttons and keyboard keys are not handled the same, and controls may have been intended to be used only on the keyboard. For example, throttle adjustment buttons may have been considered useless to be mapped to a joystick when the joystick has a throttle slider on it.

Basically in order resolve this issue, the side of the controls code that does the business needs to be majorly refactored.

Also, to clarify the situation with afterburner. That's working as intended to a degree, its just that the mousewheel is immediately released on the next frame so the afterburner effect doesn't take hold.

z64555 avatar Oct 30 '20 14:10 z64555

Dev notes:

  • Mousewheel increments should be enqueued, so that, for example,"down 5 clicks, up 3 clicks, down 1, up 2" is correctly sequenced in the game.
  • Certain Continous controls (such as afterburner) should blacklist the mousewheel from binding to them because they won't work correctly due to the nature of mousewheel clicks being a momentary switch.

z64555 avatar Apr 11 '23 15:04 z64555