-rw-r--r-- | src/controller/keyboard.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/controller/keyboard.c b/src/controller/keyboard.c index 333e2d4..6b70af2 100644 --- a/src/controller/keyboard.c +++ b/src/controller/keyboard.c | |||
@@ -1,7 +1,9 @@ | |||
1 | #include "keyboard.h" | 1 | #include "keyboard.h" |
2 | #include "clear_selection.h" | 2 | #include "clear_selection.h" |
3 | #include "selection_from_db.h" | 3 | #include "selection_from_db.h" |
4 | #include "exp004reshape.h" | ||
4 | #include "../view/exp004state0.h" | 5 | #include "../view/exp004state0.h" |
6 | #include <GL/glut.h> | ||
5 | 7 | ||
6 | #define S exp004state0 | 8 | #define S exp004state0 |
7 | 9 | ||
@@ -26,14 +28,27 @@ keyboard (unsigned char key, int x, int y) | |||
26 | selection_from_db (); | 28 | selection_from_db (); |
27 | break; | 29 | break; |
28 | 30 | ||
31 | case 'r': | ||
32 | /* | ||
33 | * Reset the view (unzoom). | ||
34 | */ | ||
35 | S.zoom.active = false; | ||
36 | exp004reshape (S.viewport.w, S.viewport.h); | ||
37 | glutPostRedisplay (); | ||
38 | break; | ||
39 | |||
40 | case 's': | ||
41 | /* | ||
42 | * Selection will be used to define a set. | ||
43 | */ | ||
44 | S.selection.purpose = SET; | ||
45 | break; | ||
46 | |||
29 | case 'z': | 47 | case 'z': |
30 | /* | 48 | /* |
31 | * Toggle zoom mode on and off. | 49 | * Selection will be use to zoom. |
32 | */ | 50 | */ |
33 | if (S.zoom) | 51 | S.selection.purpose = ZOOM; |
34 | S.zoom = false; | ||
35 | else | ||
36 | S.zoom = true; | ||
37 | break; | 52 | break; |
38 | } | 53 | } |
39 | 54 | ||