Skip to content

bindKey on commands with keyState=both won't trigger on up after restarting the resource #1424

Open
@dnl-k

Description

@dnl-k

Describe the bug
Using bindKey with keyState=both on a command stops triggering on releasing the key after restarting the resource.

To reproduce

local someVariable = false
addCommandHandler("Some Command Handler", function()
	someVariable = not someVariable
	outputChatBox("State: " .. (someVariable == true and "down" or "up"))
end)

addEventHandler("onClientResourceStart", resourceRoot, function()
	bindKey("k", "both", "Some Command Handler")
end)
  1. Start the resource
  2. Press 'K' and you will see it working properly
  3. Restart the resource
  4. Press 'K' and you will see that it won't trigger when you release the key

Expected behaviour
It should also trigger when releasing the key.

Screenshots

Version
Server/Client: 1.5.7
Windows 10 Build 18363.778

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions