Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Added Ctrl-Z common key binding
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 2, 2009
1 parent 7db67d3 commit c34f621
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/common.c
Expand Up @@ -1031,6 +1031,8 @@ PrintEvent(SDL_Event * event)
void
CommonEvent(CommonState * state, SDL_Event * event, int *done)
{
int i;

if (state->verbose & VERBOSE_EVENT) {
PrintEvent(event);
}
Expand All @@ -1051,6 +1053,15 @@ CommonEvent(CommonState * state, SDL_Event * event, int *done)
/* Ctrl-G toggle grab */
}
break;
case SDLK_z:
if (event->key.keysym.mod & KMOD_CTRL) {
/* Ctrl-Z minimize */
/* FIXME: Which window has focus for this keyboard? */
for (i = 0; i < state->num_windows; ++i) {
SDL_MinimizeWindow(state->windows[i]);
}
}
break;
case SDLK_ESCAPE:
*done = 1;
break;
Expand Down Expand Up @@ -1078,3 +1089,5 @@ CommonQuit(CommonState * state)
}
SDL_free(state);
}

/* vi: set ts=4 sw=4 expandtab: */
2 changes: 2 additions & 0 deletions test/common.h
Expand Up @@ -70,3 +70,5 @@ extern const char *CommonUsage(CommonState * state);
extern SDL_bool CommonInit(CommonState * state);
extern void CommonEvent(CommonState * state, SDL_Event * event, int *done);
extern void CommonQuit(CommonState * state);

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit c34f621

Please sign in to comment.