CottonMC/LibGui

You can't hold down the arrow/backspace in WTextField

Closed this issue · 4 comments

Describe the bug
If you try to hold down one of the horizontal arrow keys or the backspace, it only happens once and won't happen again.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new GUI with WTextField.
  2. Write some text on it.
  3. Try to hold either the left arrow, the right arrow or the backspace on it.

Expected behavior
Holding down one of the keys should keep moving the cursor/deleting characters.

Versions:

  • LibGUI 1.4.0-beta.1
  • Fabric API 0.4.28+build.288-1.15
  • Minecraft 1.15.1

Additional context
Somehow, this bug doesn't happen on LibGUI's configuration screen.

I can't reproduce this. What does your GUI description/screen controller class look like?

This is affected GUI's description and this is the affected GUI's screen (no controller because this is a client-sided GUI).

Adding Keyboard#enableRepeatEvents(true) before opening the screen seems to fix the issue, plus this isn't exclusive for LibGUI (it might be related to how I opened the screen), closing.

This seems like a poor workaround; I'll look into possibly making it automatic with LibGui screens.