Skip to content

WindowScreen & UIComponent: Improve key input handling#177

Draft
Traben-0 wants to merge 43 commits into
masterfrom
feature/key-input-improvements
Draft

WindowScreen & UIComponent: Improve key input handling#177
Traben-0 wants to merge 43 commits into
masterfrom
feature/key-input-improvements

Conversation

@Traben-0
Copy link
Copy Markdown

@Traben-0 Traben-0 commented Mar 29, 2026

Re: UniversalCraft#125

Implements the new input functions replacing the old keyType(keycode, character) functions with equivalent keyType(UIKeyEvent) & charType(UICharEvent) functions, under the new ElementaVersion.v12.

Comment thread gradle/libs.versions.toml Outdated
kotlinx-coroutines = "1.5.2"
jetbrains-annotations = "23.0.0"
universalcraft = "466"
universalcraft = "474+feature-em-1645-closing-uscreen-via-esc-on-119-puts-you-in-the-menu-rather"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending UC PR merge

Comment thread src/main/kotlin/gg/essential/elementa/UIComponent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/UIComponent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/UIComponent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/UIComponent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/UIComponent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/UIComponent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/events/UIEvent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/events/UIKeyboardEvents.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/events/UIKeyboardEvents.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/UIComponent.kt Outdated
@Traben-0 Traben-0 requested a review from Johni0702 April 6, 2026 05:28
Comment thread src/main/kotlin/gg/essential/elementa/UIComponent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/components/Window.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/WindowScreen.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/components/input/AbstractTextInput.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/components/input/AbstractTextInput.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/components/input/AbstractTextInput.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/markdown/MarkdownComponent.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/ElementaVersion.kt Outdated
Comment thread src/main/kotlin/gg/essential/elementa/events/UIKeyboardEvents.kt Outdated
@Traben-0 Traben-0 requested a review from Johni0702 April 27, 2026 03:45
return true
} else if (keyCode == UKeyboard.KEY_ENTER) { // Enter
onEnterPressed()
onEnterPressed(modifiers)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Breaking change. If a third-party subclass overrides the old method, their code will now no longer be called.

Could make this conditional on ElementaVersion.V12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants