Skip to content

bindKey and unbindKey fail to handle client key bindings correctly #4036

@q8X

Description

@q8X

Describe the bug

Key bindings on the client end can get messed up when different resources use the same key, for example, if resource (A) on server (1) has command handler but no key is bound, and a client binds key '1' to 'bug' command, and then resource (B) on server (2) also uses '1' for 'bug', unbinding '1' for 'bug' on server (2) with unbindKey("1", "down", "bug") will totally remove the client's key binding, even after they've left server

this means they can't bind '1' to 'bug' or use the same bind key for a different resource, but resources still can bind a key, to fix this they need to restart the game to bind the key again

it should display as resource key bind, like this one in the image

Image

but if the client already bound a key with the same command, the key will be added as an alt key

Image

Steps to reproduce

  1. start runcode
  2. crun addCommandHandler("bug", function() outputChatBox("hi") end)
  3. type /bind 1 bug
  4. crun bindKey("1","down","bug")
  5. crun unbindKey("1","down","bug")
  6. use the same bind key with different server

Version

No response

Additional context

No response

Relevant log output

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions