diff options
Diffstat (limited to 'src/types/command.rs')
-rw-r--r-- | src/types/command.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/types/command.rs b/src/types/command.rs index 86f83a12c181..2a51531c0a8a 100644 --- a/src/types/command.rs +++ b/src/types/command.rs @@ -1,11 +1,17 @@ use super::Direction; use super::Direction::*; use termion::event::Key; -use termion::event::Key::Char; +use termion::event::Key::{Char, Ctrl}; pub enum Command { + /// Quit the game Quit, + + /// Move the character in a direction Move(Direction), + + /// Display the previous message + PreviousMessage, } impl Command { @@ -17,6 +23,7 @@ impl Command { Char('k') | Char('w') | Key::Up => Some(Move(Up)), Char('j') | Char('s') | Key::Down => Some(Move(Down)), Char('l') | Char('d') | Key::Right => Some(Move(Right)), + Ctrl('p') => Some(PreviousMessage), _ => None, } } |