Mercurial > sdl-ios-xcode
comparison test/common.c @ 3514:f0b7bc1fe12d
Added Ctrl-Z common key binding
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 02 Dec 2009 07:56:09 +0000 |
parents | 4b594623401b |
children | 19691cebb866 |
comparison
equal
deleted
inserted
replaced
3513:b66c9e8090d4 | 3514:f0b7bc1fe12d |
---|---|
1029 } | 1029 } |
1030 | 1030 |
1031 void | 1031 void |
1032 CommonEvent(CommonState * state, SDL_Event * event, int *done) | 1032 CommonEvent(CommonState * state, SDL_Event * event, int *done) |
1033 { | 1033 { |
1034 int i; | |
1035 | |
1034 if (state->verbose & VERBOSE_EVENT) { | 1036 if (state->verbose & VERBOSE_EVENT) { |
1035 PrintEvent(event); | 1037 PrintEvent(event); |
1036 } | 1038 } |
1037 | 1039 |
1038 switch (event->type) { | 1040 switch (event->type) { |
1049 case SDLK_g: | 1051 case SDLK_g: |
1050 if (event->key.keysym.mod & KMOD_CTRL) { | 1052 if (event->key.keysym.mod & KMOD_CTRL) { |
1051 /* Ctrl-G toggle grab */ | 1053 /* Ctrl-G toggle grab */ |
1052 } | 1054 } |
1053 break; | 1055 break; |
1056 case SDLK_z: | |
1057 if (event->key.keysym.mod & KMOD_CTRL) { | |
1058 /* Ctrl-Z minimize */ | |
1059 /* FIXME: Which window has focus for this keyboard? */ | |
1060 for (i = 0; i < state->num_windows; ++i) { | |
1061 SDL_MinimizeWindow(state->windows[i]); | |
1062 } | |
1063 } | |
1064 break; | |
1054 case SDLK_ESCAPE: | 1065 case SDLK_ESCAPE: |
1055 *done = 1; | 1066 *done = 1; |
1056 break; | 1067 break; |
1057 default: | 1068 default: |
1058 break; | 1069 break; |
1076 if (state->windows) { | 1087 if (state->windows) { |
1077 SDL_free(state->windows); | 1088 SDL_free(state->windows); |
1078 } | 1089 } |
1079 SDL_free(state); | 1090 SDL_free(state); |
1080 } | 1091 } |
1092 | |
1093 /* vi: set ts=4 sw=4 expandtab: */ |