mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Add Tab key to events
This commit is contained in:
parent
3d1507c3cf
commit
0bdb86181b
@ -23,6 +23,7 @@ pub enum EventResult {
|
|||||||
#[derive(PartialEq,Eq,Clone,Copy,Hash)]
|
#[derive(PartialEq,Eq,Clone,Copy,Hash)]
|
||||||
pub enum Key {
|
pub enum Key {
|
||||||
Enter,
|
Enter,
|
||||||
|
Tab,
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
ArrowRight,
|
ArrowRight,
|
||||||
ArrowUp,
|
ArrowUp,
|
||||||
@ -39,6 +40,7 @@ pub enum Key {
|
|||||||
impl Key {
|
impl Key {
|
||||||
pub fn from_ncurses(ch: i32) -> Self {
|
pub fn from_ncurses(ch: i32) -> Self {
|
||||||
match ch {
|
match ch {
|
||||||
|
9 => Key::Tab,
|
||||||
10 => Key::Enter,
|
10 => Key::Enter,
|
||||||
127 => Key::Backspace,
|
127 => Key::Backspace,
|
||||||
330 => Key::Del,
|
330 => Key::Del,
|
||||||
@ -70,6 +72,8 @@ impl fmt::Display for Key {
|
|||||||
Key::End => "End",
|
Key::End => "End",
|
||||||
Key::Backspace => "Backspace",
|
Key::Backspace => "Backspace",
|
||||||
Key::Del => "Del",
|
Key::Del => "Del",
|
||||||
|
Key::Enter => "Enter",
|
||||||
|
Key::Tab => "Tab",
|
||||||
_ => "",
|
_ => "",
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user