kotter icon indicating copy to clipboard operation
kotter copied to clipboard

onKeyPressed doesn't listen for modified (e.g. ctrl-u, alt-a, etc.) characters

Open stephentalley opened this issue 1 year ago • 3 comments

Our app has a need to listen to various control-modified keys (ctrl-u, ctrl-f, ctrl-b, etc.). But:

session {
    var keyPressed by liveVarOf<Key?>(null)
    section {
        if (keyPressed != null) {
            textLine("key pressed: $keyPressed")
        }
    }.runUntilKeyPressed(Keys.Q, Keys.ESC) {
        onKeyPressed {
            keyPressed = key
        }
    }
}

…shows those keys are ignored.

Is there an API to listen for those keys?

  • OS: Linux
  • Version 1.1.1

stephentalley avatar Dec 17 '23 20:12 stephentalley

I don't have access to anything except that which the terminal gives me. So depending on what you're expecting, it's probably not possible. See also: https://github.com/varabyte/kotter/issues/57 in case it's related.

I wonder if you could write a raw console app, just like a naked main function and use of readLine, and see if you're getting characters in that case.

bitspittle avatar Jan 22 '24 20:01 bitspittle