gchp / rustbox

Rust implementation of the termbox library
MIT License
469 stars 48 forks source link

No alt key. #54

Closed ticki closed 8 years ago

gchp commented 8 years ago

Hello.

See this this comment for why there is no alt key be default: https://github.com/nsf/termbox/issues/44#issuecomment-67156091

Rustbox is a wrapper of the termbox library, so we are limited to the functionality it provides.

If you want to use the ALT key, you need to initialize Rustbox with the InputMode::Alt option.

ticki commented 8 years ago

Thanks!

dpc commented 5 years ago

Handling Alt is usually done by checking if ESC was followed by something. if it was not immediately followed, it was Esc keypressed. If it was - it was an Alt sequence. I don't really see a reason why this couldn't be handled directly.

Also, in Alt mode termbox sets alt modifier: https://github.com/nsf/termbox/blob/0178b0123e176b9c4656177c07af832bc141b03f/src/input.inl#L192, while rustbox seems to just ignore it.