aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-11-06 16:13:20 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-11-06 16:13:20 +0000
commit7ebfb17b8503f8913166568b487513c42806b1a2 (patch)
tree2337311357740d776123fc4aac24badf429c603e
parentc8baf09498bb47c3762ac0dbaa32f6774fbfb1af (diff)
downloadimv-7ebfb17b8503f8913166568b487513c42806b1a2.tar.gz
Compress keyboard switch statement
-rw-r--r--main.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/main.c b/main.c
index 4191e43..fb77d65 100644
--- a/main.c
+++ b/main.c
@@ -140,38 +140,18 @@ int main(int argc, char** argv)
break;
case SDL_KEYDOWN:
switch (e.key.keysym.sym) {
- case SDLK_q:
- quit = 1;
- break;
- case SDLK_RIGHT:
- prev_path();
- break;
- case SDLK_LEFT:
- next_path();
- break;
+ case SDLK_q: quit = 1; break;
+ case SDLK_RIGHT: prev_path(); break;
+ case SDLK_LEFT: next_path(); break;
case SDLK_i:
- case SDLK_UP:
- zoom_view(1);
- break;
+ case SDLK_UP: zoom_view(1); break;
case SDLK_o:
- case SDLK_DOWN:
- zoom_view(-1);
- break;
- case SDLK_r:
- reset_view();
- break;
- case SDLK_j:
- move_view(0, -50);
- break;
- case SDLK_k:
- move_view(0, 50);
- break;
- case SDLK_h:
- move_view(50, 0);
- break;
- case SDLK_l:
- move_view(-50, 0);
- break;
+ case SDLK_DOWN: zoom_view(-1); break;
+ case SDLK_r: reset_view(); break;
+ case SDLK_j: move_view(0, -50); break;
+ case SDLK_k: move_view(0, 50); break;
+ case SDLK_h: move_view(50, 0); break;
+ case SDLK_l: move_view(-50, 0); break;
}
break;
case SDL_MOUSEWHEEL: