-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
What happened?
Remapping a keybind to the same key while holding it down causes the keybind to permanently stop responding. This affects resources using RegisterKeyMapping with command pairs (+command / -command) like pma-voice radio talk.
When a player presses a keybind at the exact moment of remapping it to the same key, the keybind completely stops responding. The -command is never called, variables remain stuck at true, and both physical key presses and ExecuteCommand() calls are completely ignored. The keybind becomes entirely dead.
Expected result
The keybind should continue working after remapping, or at minimum there should be a Lua API to reset the key state. Players shouldn't need to restart the entire FiveM client to recover from this.
Reproduction steps
- Join server with a working keybind (e.g., LEFT ALT for radio talk)
- Open: ESC → Settings → Keybinds → FiveM
- Find the keybind and click to remap it
- Press the SAME KEY to remap (LEFT ALT → LEFT ALT)
- At this exact moment, the
+commandtriggers before the remapping completes
- At this exact moment, the
- Try pressing the key again → Nothing happens, keybind is completely dead
-- fxmanifest.lua
fx_version 'cerulean'
game 'gta5'
client_script 'test.lua'
-- test.lua
local isPressed = false
RegisterCommand('+testkey', function()
isPressed = true
print("Key pressed")
end, false)
RegisterCommand('-testkey', function()
isPressed = false
print("Key released")
end, false)
RegisterKeyMapping('+testkey', 'Test Key', 'keyboard', 'F9')
RegisterCommand('checkstate', function()
print("isPressed =", isPressed)
end, false)Importancy
There's a workaround
Area(s)
FiveM
Specific version(s)
(b3095) (Canary)
Additional information
No response