uiTextInput does not 'consume' key presses; they are still captured by a keys {...} block
- Dominant language
- Kotlin
- Stars
- 3k
- Forks
- 148
- Avg merge
- 13h 44m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
Using korge-next and experimenting with UI elements, I noticed that `uiText` does not consume key presses and they are still picked up by other views. Fairly simple to reproduce:
```kotlin
suspend fun main() = Korge(quality = GameWindow.Quality.PERFORMANCE, title = "UI", width = 1280, height = 600) {
container {
keys {
down(Key.E) { println("E pressed"}
}
uiTextInput("A simple Text Input")
}
}
```
Run this program, and type some text into the input box which includes the letter "E". You will see that "E pressed" is displayed on the console.
(Additionally, uiText doesn't work at all with Ctrl-X, Ctrl-V, even Ctrl-A to select all - all appear as an inverted ? character.)
**Annoyment level**
> How annoyed are you in a scale of 1-3 because this shitty code doesn't work properly
* [x] 1 - No rush from my side
* [ ] 2 - It is inconvenient, but I can circumvent the issue for now
* [ ] 3 - FUUUU
* [ ] 4
**Payment**
> How do you plan to compensate the time we will invest fixing this?
* [x] I will add a message with "Thanks" when merged to let you know I'm grateful
* [ ] I will also add a [meme image](https://imgflip.com/memegenerator) relevant to the issue to make you smile so we both have fun
* [ ] In fact, I'm going to add a meme here in this issue too
* [ ] I'm going to write about KorGE in my blog, spread the voice on social networks, or maybe even make a TikTok wearing a KorGE T-Shirt while dancing
> You can also consider donating some money via Github Sponsors to the person fixing the issue.
**Meme**
> Here you can put a meme to motivate us to fix the issue.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Kotlin reproduction in the issue, then trace uiTextInput and the keys block's event handling. Verify how typed keys and Ctrl-X, Ctrl-V, and Ctrl-A are represented and whether input events are consumed. Done means text input no longer reaches the surrounding keys handler and the listed control shortcuts work normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- frontend, game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100