Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Added key bindings to resize the window (+/-)

  • Loading branch information
slouken committed Oct 3, 2012
1 parent 8f6ef3a commit 5a435ac0f517736b68ac7faafa3811070fb095ba
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/common.c
@@ -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! */

0 comments on commit 5a435ac

Please sign in to comment.