Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player Position Key (G) can't be triggered while being rebinded to mouse 4/5 key (side key) #190

Closed
boholder opened this issue Oct 27, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@boholder
Copy link
Member

boholder commented Oct 27, 2023

By Amorphous Note from Discord.

@boholder boholder added the bug Something isn't working label Oct 27, 2023
@boholder boholder self-assigned this Nov 4, 2023
@boholder
Copy link
Member Author

boholder commented Nov 11, 2023

When set some keybinding to mouse key 4,5 (side mouse key), there will be flow of error log that repeats:

[08:36:08] [Render thread/ERROR] (Minecraft) ########## GL ERROR ##########
[08:36:08] [Render thread/ERROR] (Minecraft) @ Pre render
[08:36:08] [Render thread/ERROR] (Minecraft) 65539: Invalid key 3

Key value 3 is the value of glfw mouse key 4 according to https://www.glfw.org/docs/3.3/group__buttons.html
Google says that this error frequently occurred at 2020-2021, which is because at that time the GLFW had not register side mouse keys, you can resolve this by not use side mouse keys or manually upgrade LGLFW library.

This error will be thrown right after the logic that checking if the key is pressed, inside this mod, it's triggered by this mod.
It is net.minecraft.client.util.InputUtil isKeyPressed(long handle, int code) will throw the error when the code is 3, the InputUtil.isKeyPressed method is called in this mod's InputUtil.

So... according to others advice:

key 3 of type MOUSE is valid, key 3 of type KEYSYM is not, so its important it is the correct type when mapped.
InputUtil.isKeyPressed shouldnt be called (there is check for key type before its called)

KeyBindings have a field called "pressed" that is set to true when they are pressed. they should just be checking the state of that field with the KeyBinding's "isPressed()" method
Mouse handles setting this for mouse type keybindings

boholder added a commit to boholder/minecraft-access that referenced this issue Nov 11, 2023
boholder added a commit to boholder/minecraft-access that referenced this issue Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant