aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.c b/main.c
index 91770a7..2178d2e 100644
--- a/main.c
+++ b/main.c
@@ -145,13 +145,17 @@ int main(int argc, char **argv) {
while (1) {
draw_map(map, width, height, start_pos, end_pos, NULL, path, visited, NULL);
- char c = getch();
+ 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 '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;
case 'y':
case 'o':
@@ -211,6 +215,7 @@ int main(int argc, char **argv) {
visited = visited_new(width, height);
path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim);
break;
+ case KEY_RESIZE: clear(); break;
case 'q': map_free(map, height); path_free(path, height); endwin(); return 0;
}
}