mirror of https://github.com/TaKO8Ki/gobang
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
613 B
Rust
24 lines
613 B
Rust
use crate::event::Key;
|
|
use database_tree::MoveSelection;
|
|
|
|
pub mod scrollbar;
|
|
pub mod scrolllist;
|
|
|
|
pub fn common_nav(key: Key) -> Option<MoveSelection> {
|
|
if key == Key::Char('j') {
|
|
Some(MoveSelection::Down)
|
|
} else if key == Key::Char('k') {
|
|
Some(MoveSelection::Up)
|
|
} else if key == Key::PageUp {
|
|
Some(MoveSelection::PageUp)
|
|
} else if key == Key::PageDown {
|
|
Some(MoveSelection::PageDown)
|
|
} else if key == Key::Char('l') {
|
|
Some(MoveSelection::Right)
|
|
} else if key == Key::Char('h') {
|
|
Some(MoveSelection::Left)
|
|
} else {
|
|
None
|
|
}
|
|
}
|