maruohon / malilib

Library mod for masa's client-side Minecraft mods
GNU Lesser General Public License v3.0
294 stars 124 forks source link

Almost all Hotkeys stop working after switching Keyboard layout. #80

Closed gamescom15 closed 2 years ago

gamescom15 commented 2 years ago

Steps to reproduce:

In this state you can't open any mailib menus and most hotkeys stop working.

Note: For some reason, the Zoom hotkey (in this case c) keeps working (definitely the tweakeroo hotkey, the scroll zoom works and shows the tweakeroo zoom level)

maruohon commented 2 years ago

I'm assuming some of the keys used to switch the layout are then getting stuck, because the game doesn't see the key release event? Most of the "feature toggle" or "action" type hotkeys are by default set to not allow any extra keys to be held, whereas the "modifier" type keys like zoom activation do allow extra keys by default.

You can check if and which keys get stuck when you do this using the malilib keybindDebugging option (A + C or via Mod Menu). It will show you any key presses and which keys are being held (as far as seeing the press and release events goes). If it's a key getting stuck, then there is nothing I can do in the mod to fix it, since it's simply the game not seeing the key release event, so it has no way of knowing that the key is actually not down anymore. The only "fix" is to press again the key(s) that are getting stuck.

gamescom15 commented 2 years ago

Yep, that was it. Thanks for the quick response!

gamescom15 commented 2 years ago

Since there's probably no easy way to "fix" this, i'll close this for now.

maruohon commented 2 years ago

The best "fix" is to find and press once the key that got stuck. But you can also work around this by changing the Allow Extra Keys settings to true for the hotkeys that you most often encounter this with. Or alternatively if the key that gets stuck is a key that you don't use in any hotkeys in malilib-based mods, then you can also add that key to the ignoredKeys setting in malilib, and then malilib will not track presses of that key at all.