aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-13 14:32:46 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-13 14:32:46 +0300
commit3749cb79b6de6d966248f603c40107c44e719cce (patch)
treebe262b230e4eaaf2fc1b16c94f20204e85a64516 /main.c
parent5069c784436a667048672c8289caddb04242a29f (diff)
downloadastar-3749cb79b6de6d966248f603c40107c44e719cce.tar.xz
Add keybindings to move faster
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index 2178d2e..be36753 100644
--- a/main.c
+++ b/main.c
@@ -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;