JakeWharton / mosaic

Build terminal UI in Kotlin using Jetpack Compose
Apache License 2.0
1.87k stars 56 forks source link

Add jline3 and expose raw keyboard input somehow #10

Open JakeWharton opened 3 years ago

JakeWharton commented 3 years ago

Probably modifiers, just like Android/Desktop Compose.

opatry commented 2 years ago

You mean, having Modifier.onKeyEvent(), right? If so, I guess KeyEvent would be different from the Android/Desktop one which is in the ui package.

JakeWharton commented 2 years ago

It's probably not that different in shape, but yes we are not reusing anything from Compose UI / Foundation.

EpicDima commented 2 months ago

I think we can use mordant to handle the user input that was added in this pull request. It remains only to wait for the official new version to try

JakeWharton commented 2 months ago

Yeah just saw that earlier. Cool!

JakeWharton commented 2 months ago

This version upgrade just landed.

JakeWharton commented 2 weeks ago

Did most of this today in the keys branch. Will try to finish it tonight.

Probably need to restore MosaicScope to add an exitApplication function similar to what Compose UI for Desktop does. I'm also unsure what to do about Ctrl+C handling. It might be worth having automatic handling of that with some kind of opt-out.

JakeWharton commented 2 weeks ago

Also I'm about to unconditionally put the terminal in raw mode. Is there any reason to not do that? I see a few other frameworks unconditionally do it as well.

JakeWharton commented 2 weeks ago

For ctrl+c, if no one handles it in a modifier, we'll exit. Otherwise, you're on your own.