diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-13 14:32:46 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-13 14:32:46 +0300 |
| commit | 3749cb79b6de6d966248f603c40107c44e719cce (patch) | |
| tree | be262b230e4eaaf2fc1b16c94f20204e85a64516 | |
| parent | 5069c784436a667048672c8289caddb04242a29f (diff) | |
| download | astar-3749cb79b6de6d966248f603c40107c44e719cce.tar.xz | |
Add keybindings to move faster
| -rw-r--r-- | main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -148,12 +148,15 @@ int main(int argc, char **argv) { int c = getch(); /* TODO: add a keybinding to calculate the path again, or maybe do it on 'a' */ /* TODO: maybe a kbng to move to start/end? */ - /* TODO: big HJKL to move fasta */ switch (c) { case 'h': map_offset_x += 2; break; case 'l': map_offset_x -= 2; break; case 'j': map_offset_y -= 1; break; case 'k': map_offset_y += 1; break; + case 'H': clear(); map_offset_x += 20; break; + case 'L': clear(); map_offset_x -= 20; break; + case 'J': clear(); map_offset_y -= 10; break; + case 'K': clear(); map_offset_y += 10; break; case 'z': clear(); map_offset_x = 2; map_offset_y = 1; break; /* Move to top left corner */ case 'x': clear(); map_offset_x = - width * 2 + COLS - 2; map_offset_y = - height + LINES - 2; break; /* Move to bottom right corner */ case 'a': anim = !anim; break; |
