jak-project/goal_src/jak1/pc
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
..
debug save & load game territory setting (#3243) 2023-12-03 18:19:38 +00:00
features Fix starting continue point for Hub 2/3 category extensions (#3103) 2023-10-29 02:17:32 +01:00
util Basic hash table and jump table (#1837) 2023-08-01 17:09:14 -04:00
hud-classes-pc.gc fix controller vibration (#1685) 2022-07-19 19:06:05 -04:00
pckernel-common.gc 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
pckernel-h.gc 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
pckernel-impl.gc 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
pckernel.gc [jak2] implement pc cheats in menu (#3275) 2023-12-28 11:14:10 +00:00
progress-pc.gc 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
README.md jak2: Create goal_src skeleton (#1576) 2022-06-29 22:20:09 -04:00
subtitle.gc fix (font-flags left) name + fix right flag not reflecting in debug text box (#3020) 2023-09-24 03:00:09 +01:00

This directory contains new source code files used for the PC port