summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClementTsang <cjhtsang@uwaterloo.ca>2020-02-10 00:26:17 -0500
committerClementTsang <cjhtsang@uwaterloo.ca>2020-02-10 00:26:17 -0500
commit37b1d93d0530ec693c0d21d5eb936f191e3e71a7 (patch)
tree159173d9370feae48d0f782c41ccd87a3b656368 /src
parent60b6a0911a109018c5825267a1a9905913c47b96 (diff)
removed control + hjkl again, added shift + hjkl (or just HJKL) to navigate widgets
Diffstat (limited to 'src')
-rw-r--r--src/main.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 40689b38..8405ba7c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -197,6 +197,7 @@ fn main() -> error::Result<()> {
if let Ok(recv) = rx.recv_timeout(Duration::from_millis(TICK_RATE_IN_MILLISECONDS)) {
match recv {
Event::KeyInput(event) => {
+ debug!("Event: {:?}", event);
if event.modifiers.is_empty() {
// If only a code, and no modifiers, don't bother...
@@ -212,6 +213,10 @@ fn main() -> error::Result<()> {
KeyCode::Down => app.on_down_key(),
KeyCode::Left => app.on_left_key(),
KeyCode::Right => app.on_right_key(),
+ KeyCode::Char('H') => app.move_left(),
+ KeyCode::Char('L') => app.move_right(),
+ KeyCode::Char('K') => app.move_up(),
+ KeyCode::Char('J') => app.move_down(),
KeyCode::Char(character) => app.on_char_key(character),
KeyCode::Esc => app.on_esc(),
KeyCode::Enter => app.on_enter(),
@@ -225,10 +230,10 @@ fn main() -> error::Result<()> {
match event.code {
KeyCode::Char('c') => break,
KeyCode::Char('f') => app.enable_searching(),
- KeyCode::Left | KeyCode::Char('h') => app.move_left(),
- KeyCode::Right | KeyCode::Char('l') => app.move_right(),
- KeyCode::Up | KeyCode::Char('k') => app.move_up(),
- KeyCode::Down | KeyCode::Char('j') => app.move_down(),
+ KeyCode::Left => app.move_left(),
+ KeyCode::Right => app.move_right(),
+ KeyCode::Up => app.move_up(),
+ KeyCode::Down => app.move_down(),
KeyCode::Char('r') => {
if rtx.send(ResetEvent::Reset).is_ok() {
app.reset();