crossterm
crossterm copied to clipboard
Support key/mouse up events for linux.
Describe the solution you'd like for example, I want do something when I press up a key(e.g. 'h')
Describe alternatives you've considered in any different KeyCode into KeyCodeDown and KeyCodeUp if it needn't backforward compatible
Maybe something as described here could be implemented: https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html#
And just a simple boolean to indicate a press/release in KeyEvent: https://github.com/crossterm-rs/crossterm/blob/master/src/event.rs#L390
https://blog.robertelder.org/detect-keyup-event-linux-terminal/
Detecting a key release in linux usually require root (unless you rely on x server) , if the user is in the input group he can read it with no more previlage but I dont know which distros do his
It would be really nice to have the option of detecting keyup events, even if that means the user has to be in the input group or have sudo rights. A lot of cli applications require sudo anyway. If the user is neither sudo, nor in the input group, the event handler could just return a Error in the Result.
Renaming the issue, since windows does mouse-up event support.
Linux already supported mouse up/down events, its the keys support that is missing.
This commit https://github.com/crossterm-rs/crossterm/commit/60e51be726f00b8df9c79b72a55d6b9f2a40a507 fixes this by using the kitty protocol. (but you need a supported terminal)
Gonna close this in favor of #695