virtualx-engine/platform
Connor Lirot dd021099ff Fix for linux joypad D-pad zeroing
Some controllers (notably those made by 8bitdo) do not always emit an event to zero out a D-pad axis before flipping direction. For example, when rolling around aggressively the D-pad of an 8bitdo SN30 Pro/Pro+, the following may be observed:

```
ABS_HAT0X : -1
ABS_HAT0Y : -1
ABS_HAT0Y : 0
ABS_HAT0Y : 1
ABS_HAT0X : 1
```

Notable here is that no event for `ABS_HAT0X: 0` is emitted between the events for `ABS_HAT0X: -1` and `ABS_HAT0X: 1`. Consequently, the game engine believes that both the negative _and_ positive x-axis directions of the D-pad are activated simultaneously (i.e `is_joy_button_pressed()` returns `true` for both `JOY_BUTTON_DPAD_LEFT` and `JOY_BUTTON_DPAD_RIGHT`), which should be impossible.

This issue is _not_ reproducible on all controllers. The Xbox One controller in particular will not exhibit this problem (it always emits zeroing out events for an axis before flipping direction).

The fix is to always zero out the opposite direction on the D-pad axis in question when processing an event with a nonzero value. This unfortunately wastes a small number of CPU cycles on controllers that behave nicely.

**I have verified this issue is also reproducible in the stable 3.2 branch**
2020-11-11 13:54:46 -06:00
..
android Reorganized core/ directory, it was too fatty already 2020-11-07 20:17:12 -03:00
iphone iOS Export: support multi-target plugin 2020-11-10 16:40:06 +03:00
javascript [HTML5] AudioWorklet API implementation. 2020-11-10 18:56:21 +01:00
linuxbsd Fix for linux joypad D-pad zeroing 2020-11-11 13:54:46 -06:00
osx Remove debug_symbols=full in favor of debug_symbols=yes 2020-11-09 15:48:30 +01:00
server Remove debug_symbols=full in favor of debug_symbols=yes 2020-11-09 15:48:30 +01:00
uwp Reorganized core/ directory, it was too fatty already 2020-11-07 20:17:12 -03:00
windows Merge pull request #43412 from akien-mga/variant-rename-_RID-to-RID 2020-11-09 17:46:34 +01:00
register_platform_apis.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
SCsub SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00