godot/platform/linuxbsd
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
..
export Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
context_gl_x11.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
context_gl_x11.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
crash_handler_linuxbsd.cpp Reorganized core/ directory, it was too fatty already 2020-11-07 20:17:12 -03:00
crash_handler_linuxbsd.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
detect_prime_x11.cpp Reorganized core/ directory, it was too fatty already 2020-11-07 20:17:12 -03:00
detect_prime_x11.h Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
detect.py Remove debug_symbols=full in favor of debug_symbols=yes 2020-11-09 15:48:30 +01:00
display_server_x11.cpp Reorganized core/ directory, it was too fatty already 2020-11-07 20:17:12 -03:00
display_server_x11.h Reorganized core/ directory, it was too fatty already 2020-11-07 20:17:12 -03:00
godot_linuxbsd.cpp t Add unit testing to Godot using DocTest and added to GitHub Actions CI 2020-07-24 13:05:33 +01:00
joypad_linux.cpp Fix for linux joypad D-pad zeroing 2020-11-11 13:54:46 -06:00
joypad_linux.h Rename InputFilter back to Input 2020-04-28 15:19:49 +02:00
key_mapping_x11.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
key_mapping_x11.h Port member initialization from constructor to declaration (C++11) 2020-05-14 10:01:56 +02:00
logo.png Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
os_linuxbsd.cpp Changed shell_open behaviour 2020-10-26 13:26:39 +00:00
os_linuxbsd.h Port ClassDB tests to use doctest 2020-08-16 16:41:02 +03:00
pck_embed.ld Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
pck_embed.legacy.ld Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
platform_config.h Linux/BSD: Fix support for NetBSD 2020-09-18 10:27:55 +02:00
platform_linuxbsd_builders.py SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00
SCsub Remove debug_symbols=full in favor of debug_symbols=yes 2020-11-09 15:48:30 +01:00
vulkan_context_x11.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
vulkan_context_x11.h Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00