diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-13 14:39:39 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-13 14:39:39 +0300 |
| commit | f817a761f00f07b7f57518065da0f5fd8ccf4c9d (patch) | |
| tree | dba5ba853399880b12f855c53f96936a0e4a2dfd | |
| parent | 3749cb79b6de6d966248f603c40107c44e719cce (diff) | |
| download | astar-f817a761f00f07b7f57518065da0f5fd8ccf4c9d.tar.xz | |
Add a keybinding to move to start/end
| -rw-r--r-- | main.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -159,6 +159,20 @@ int main(int argc, char **argv) { 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 'g': + switch (getch()) { + case 's': + clear(); + map_offset_x = -start_pos.x * 2 + COLS/2; + map_offset_y = -start_pos.y + LINES/2; + break; + case 'e': + clear(); + map_offset_x = -end_pos.x * 2 + COLS/2; + map_offset_y = -end_pos.y + LINES/2; + break; + } + break; case 'a': anim = !anim; break; case 'y': case 'o': |
