Skip to content

Commit

Permalink
keyup
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Dec 30, 2024
1 parent ca8f981 commit ace6386
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules
Cargo.lock

**/*.gb
**/*.gbc
**/*.gbsave

# These are backup files generated by rustfmt
Expand Down
4 changes: 4 additions & 0 deletions src/screen/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,16 @@ fn run_app<B: Backend>(
app.on_key(c, gameboy);
} else if let KeyCode::Up = key.code {
gameboy.keydown(KeypadKey::Up);
app.last_key = Some(KeypadKey::Up);
} else if let KeyCode::Down = key.code {
gameboy.keydown(KeypadKey::Down);
app.last_key = Some(KeypadKey::Down);
} else if let KeyCode::Left = key.code {
gameboy.keydown(KeypadKey::Left);
app.last_key = Some(KeypadKey::Left);
} else if let KeyCode::Right = key.code {
gameboy.keydown(KeypadKey::Right);
app.last_key = Some(KeypadKey::Right);
}
}
}
Expand Down

0 comments on commit ace6386

Please sign in to comment.