jak-project/game
Tyler Wilding d1a6c60eb8
game: disable keyboard input by default, give users a way to enable it via the imgui menu (#3295)
It was narrowed down recently that a lot of people have issues with the
controller input because of Steam Input working as intended. Steam Input
can be configured to replicate controller inputs as keyboard inputs (for
example, pressing X on your controller presses Enter on the keyboard).

This results in the problem of "jumping pauses the game" and similar
issues. This is a consequence of the intended behaviour of the game
listening to all input sources at the same time.

Since the vast majority of players are using controllers over keyboards,
it makes sense to disable the keyboard input by default to solve this
problem. However that makes things awkward for users that want to use
the keyboard (how do they enable the setting). The solution is a new
imgui option in the settings menu:
![Screenshot 2024-01-07
141224](https://github.com/open-goal/jak-project/assets/13153231/6f9ffa2d-be7a-433d-b698-15b70210e97e)

**Known issue that I don't care about** -- in Jak 1's menu code, since
the flags are controlled by pointers to values instead of a lambda like
in jak 2, the menu won't update live with the imgui option. This has no
functional impact and I don't care enough to fix it.

I also made the pc-settings.gc file persist on first load if the file
wasn't found. Hopefully this helps diagnose the support issues related
to the black screen.

# Why not just ignore the keyboard inputs for a period of time?

This won't work, the keyboard is polled every frame. Therefore if you
hold down the X button on your controller, steam is continuously
signaling that `Enter` is held down on the keyboard.

Yes it would be possible to completely disable the keyboard while the
controller is being used, but this defeats the purpose of creating an
input system that allows multiple input sources at the same time.

With an explicit option, not only can the user decide the behaviour they
want (do they want the keyboard ignored or simultaneously listened to)
but we avoid breaking strange edge-cases in usage leading to never
ending complexity:
- ie. imagine steam input sends events to the mouse, well you can't
disable the mouse while using the keyboard because most times people are
using mouse and keyboard
- ie. a user that wants to hold a direction with the keyboard and press
buttons on the controller in tandem (something i frequently do while
TAS'ing, to move in a perfect straight line)
2024-02-23 18:19:07 -05:00
..
assets New Crowdin updates (#3382) 2024-02-19 23:17:29 -05:00
common [jak3] Decomp for gkernel, gkernel-h, gstate, gstring (#3326) 2024-01-21 18:08:05 -05:00
external game: refactor discord code and improve jak 2 support (#2714) 2023-06-17 05:16:40 +01:00
graphics game: disable keyboard input by default, give users a way to enable it via the imgui menu (#3295) 2024-02-23 18:19:07 -05:00
kernel game: disable keyboard input by default, give users a way to enable it via the imgui menu (#3295) 2024-02-23 18:19:07 -05:00
mips2c Decompile joint, collide-func, clean up joint decompression code for all games (#3369) 2024-02-11 09:50:07 -05:00
overlord game: disable keyboard input by default, give users a way to enable it via the imgui menu (#3295) 2024-02-23 18:19:07 -05:00
sce [jak2] fully implement *user* (#3046) 2023-10-01 04:28:30 +01:00
settings game: disable keyboard input by default, give users a way to enable it via the imgui menu (#3295) 2024-02-23 18:19:07 -05:00
sound Switch to std::span (#3376) 2024-02-18 13:23:19 -05:00
system game: disable keyboard input by default, give users a way to enable it via the imgui menu (#3295) 2024-02-23 18:19:07 -05:00
tools i18n: transcribe missing english subtitles (#3199) 2023-11-18 14:06:01 -05:00
CMakeLists.txt Fix remaining cpp20 issues (#3375) 2024-02-17 20:16:46 -05:00
main.cpp tracing: add some more startup related events and a new --profile-until-event flag (#3385) 2024-02-23 14:44:17 -05:00
runtime.cpp [jak3] Decomp for gkernel, gkernel-h, gstate, gstring (#3326) 2024-01-21 18:08:05 -05:00
runtime.h g/j2: Integrate highscores with Speedrun.com/JakSpeedruns.com when speedrunner mode is enabled (#3037) 2023-10-11 20:43:55 -04:00