[Enhanced] No in-game keyboard input under Linux/Proton, mouse works, F8 console doesn't open

What is the issue you’re having?

Disclaimer first: I’m not asking anyone to fix Linux support, and I’m not asking for anticheat protected servers to work on Linux.

I know it’s unsupported and I’m not expecting that to change. The only reason I’m posting is that if this turns out to be a small fix, it would open the door for Linux devs to run FiveM locally and build scripts and resources for the platform. That alone seemed worth flagging.

If a dev happens to read this and something comes to mind, that would be great, but no expectations either way.

So, I got FiveM for GTA V Enhanced running under Proton, and everything works except the keyboard.

The launcher loads fine, server list is browsable, connecting works, the game loads and renders, and mouse input is completely normal. I can look around and click. But no keypress reaches the game at all. No WASD, no chat, no pause menu, nothing.

The bit I keep coming back to is that F8 doesn’t open the FiveM console either. As far as I understand it that’s handled by FiveM’s own input layer before GTA’s input handling ever gets involved, so it doesn’t feel like a “GTA isn’t receiving keys” problem, it feels like something further up.

The control test that made me stop blaming my own setup: the exact same GTA V Enhanced install, in the exact same Proton prefix, launched standalone through the Rockstar Games Launcher, has a fully working keyboard. Only FiveM’s path is dead.

Versions, for reference:

  • FiveM for GTA V Enhanced client build 107
  • GTA V Enhanced 1.0.1158.13 (Rockstar Games Launcher install)
  • FiveM gamecache: gamecache_gen9/1158_13 (the only build present)

What have you tried already to fix the issue?

Quite a lot. All of these were actually tested and none of them made any difference:

  • Wine keyboard broken in general: ran Notepad in the same prefix, typing works fine
  • Window manager not passing focus: checked the KWin event log, game window activates correctly with wantsInput=true
  • Keyboard hardware: swapped to a wired Logitech keyboard, no change
  • Phantom gamepad (my keyboard’s HID exposes ABS axes and udev tags it event-joystick, so SDL might see a controller): set SDL_GAMECONTROLLER_IGNORE_DEVICES for both VIDs, no change
  • Layout/locale mismatch: forced LANG=en_US.UTF-8, the HKL did change (0x0c090c09 to 0x04090409) but the symptom didn’t
  • GTA’s Raw Input vs Windows setting: standalone works either way, FiveM unaffected
  • Rockstar Launcher holding focus: closed it, also tried pre-launching it separately, no change
  • NUI holding keyboard focus: read the server’s chat resource, it does SetNuiFocus(false) at startup and only grabs on keypress
  • Game build mismatch: tried sv_enforceGameBuild on the server, no change, 1158_13 is the only build in gamecache anyway
  • Proton’s native Wayland driver: PROTON_ENABLE_WAYLAND=1 actually made it worse, both FiveM and RGL render blank. Reverted.

Then I ran the client for about 10 minutes with WINEDEBUG=+rawinput,+keyboard, logged in, connected to a server, mashed keys and counted what came out:

```
3,074,072 trace:keyboard:NtUserActivateKeyboardLayout
20,000 trace:keyboard:X11DRV_KEYBOARD_DetectLayout
10,432 trace:keyboard:X11DRV_InitKeyboard (34 full keymap re-inits)
3,314 trace:rawinput:NtUserGetRawInputData (mouse working)
6 trace:rawinput:NtUserRegisterRawInputDevices
```

Three million calls to ActivateKeyboardLayout in ten minutes, all identical, all from a single thread:

```
trace:keyboard:NtUserActivateKeyboardLayout layout 0x4090409, flags 40000000
fixme:keyboard:NtUserActivateKeyboardLayout flags 40000000 not supported
```

0x40000000 is KLF_RESET, which Wine doesn’t implement, hence the fixme and presumably hence whatever is sitting there retrying forever.

This is where I got stuck. In the open source legacy client, ActivateKeyboardLayout is stubbed to a no-op and installed as an IAT hook (InputHook.cpp:389 and :818), so the wrapper returns without ever touching the OS. Which made me think, if that hook were in effect here, those three million calls shouldn’t be reaching Wine at all. And the same code site is where the rest of the keyboard setup goes in, including the MapGameKey replacement in KeyboardLayoutMapping.cpp:337, which is the thing that actually turns a keypress into game input. Those are byte pattern signature hooks and they fail silently when the pattern doesn’t match, nothing logs.

Big caveat though. That’s the legacy client source, which has zero gen9/Enhanced code in it. So I’m inferring the mechanism, not reading what Enhanced actually does, since that’s closed source. The ActivateKeyboardLayout loop could just as easily be a symptom of something further upstream, or Wine being noisy about a flag while the real problem is somewhere I never looked. Treat it as a lead, not an answer.

What I’m fairly confident about regardless of cause: it isn’t focus, isn’t hardware, isn’t layout, isn’t the window manager, isn’t GTA’s input mode and isn’t the game build. And there’s nothing on my end that fixes it. No env var, registry key, Proton version or window rule. Believe me, I tried.

What server did you get this issue on?

Every server I tried, including a completely stock local server with no resources beyond the defaults. Not server-specific.

Windows version

Arch Linux, kernel 7.1.4-arch1-1, KDE Plasma 6.7.3 on Wayland (Wine runs via XWayland)

System specifications

AMD Ryzen 7 5700X
64GB
NVIDIA RTX 4070

Antivirus software

N/A

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the Cfx.re community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!
:mascot: