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

Commit

Permalink
Added key bindings to resize the window (+/-)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 3, 2012
1 parent 8f6ef3a commit 5a435ac
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/common.c
Expand Up @@ -1100,6 +1100,24 @@ CommonEvent(CommonState * state, SDL_Event * event, int *done)
}
}
break;
case SDLK_EQUALS: {
SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
if (window) {
int w, h;
SDL_GetWindowSize(window, &w, &h);
SDL_SetWindowSize(window, w*2, h*2);
}
}
break;
case SDLK_MINUS: {
SDL_Window *window = SDL_GetWindowFromID(event->key.windowID);
if (window) {
int w, h;
SDL_GetWindowSize(window, &w, &h);
SDL_SetWindowSize(window, w/2, h/2);
}
}
break;
case SDLK_c:
if (event->key.keysym.mod & KMOD_CTRL) {
/* Ctrl-C copy awesome text! */
Expand Down

0 comments on commit 5a435ac

Please sign in to comment.