mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-09 10:50:40 +00:00
[PAN] Interprete 'carriage return' as 'enter' (#342)
Pancurses returns different key codes for "Enter" in the normal area ('\r'), and the one in the numpad ('\n'). Cursive only interpretes '\n' as Enter, and leaves '\r' as CtrlChar('m'), which is different than that with NCurses on Linux, and makes 'Enter' key not trigger a clicked event on buttons.
This commit is contained in:
parent
cf86f64334
commit
df0391aef2
@ -135,7 +135,8 @@ impl Backend {
|
||||
|
||||
if let Some(ev) = self.window.getch() {
|
||||
Some(match ev {
|
||||
pancurses::Input::Character('\n') => Event::Key(Key::Enter),
|
||||
pancurses::Input::Character('\n')
|
||||
| pancurses::Input::Character('\r') => Event::Key(Key::Enter),
|
||||
// TODO: wait for a very short delay. If more keys are
|
||||
// pipelined, it may be an escape sequence.
|
||||
pancurses::Input::Character('\u{7f}')
|
||||
|
Loading…
Reference in New Issue
Block a user