mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Fix backspace detection
Backspace is code 127 (so right inside utf-8 territory) but we want to treat is as special key, like codes < 32.
This commit is contained in:
parent
0bdb86181b
commit
35c48e13d8
@ -202,7 +202,7 @@ impl Cursive {
|
|||||||
let ch = ncurses::getch();
|
let ch = ncurses::getch();
|
||||||
|
|
||||||
// Is it a UTF-8 starting point?
|
// Is it a UTF-8 starting point?
|
||||||
if 32 <= ch && ch < 0x100 {
|
if 32 <= ch && ch < 0x100 && ch != 127 {
|
||||||
Event::CharEvent(utf8::read_char(ch as u8, || ncurses::getch() as u8).unwrap())
|
Event::CharEvent(utf8::read_char(ch as u8, || ncurses::getch() as u8).unwrap())
|
||||||
} else {
|
} else {
|
||||||
Event::KeyEvent(Key::from_ncurses(ch))
|
Event::KeyEvent(Key::from_ncurses(ch))
|
||||||
|
Loading…
Reference in New Issue
Block a user