MaLiLib (Forge)

MaLiLib (Forge)

291k Downloads

Too many debug messages on key held

Naheulf opened this issue ยท 1 comments

commented

Description of the Issue

MaLiLib send too many messages if one key is held.

Steps to Reproduce the Issue

  1. Run minecraft in a way you can see the stdout (console output)
  2. Open malilib config
  3. Set keybindDebugging to true
  4. Press and hold any key for few seconds
  5. Release the key

Expected Behavior

Only two or three messages should be send:
"PRESS D (32), held keys: D (32)"
"held keys: D (32)" (optional)
"RELEASE D (32), held keys: "

Actual Behavior

The "PRESS " message is send many times per second

[15:42:24] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:24] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:24] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:24] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:24] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:24] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:24] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:24] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:25] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:25] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:25] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:25] [Client thread/INFO] [malilib]: PRESS D (32), held keys: D (32)
[15:42:25] [Client thread/INFO] [malilib]: RELEASE D (32), held keys: <none>

Debug Information

Tested with theses mods:

  • forge | 14.23.5.2836 | forge-1.12.2-14.23.5.2836-universal.jar
  • MaLiLib | 0.10.0-dev.21.pre2 | malilib-forge-1.12.2-0.10.0-dev.21.pre2.jar
  • itemscroller | 0.15.0-dev.20190722.0 | itemscroller-forge-1.12.2-0.15.0-dev.20190722.054145.jar
commented

This happens in GUIs or other contexts where Keyboard.enableRepeatEvents(true) has been called. As far as anything using key events is concerned, those repeat events are the same as the normal initial key press. So this is pretty much working as intended, although it's true that it gets very spammy.

I think I could add an option to the keybind debugging to basically omit those repeat event messages if they are not desired, but I won't hard-code remove those completely as they can be useful/vital in some cases.