diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2011-08-27 12:14:20 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-29 11:28:11 (GMT) |
| commit | e1959c0c0bd2291232701b799ec1560c9962ff85 (patch) | |
| tree | 4bd0174e23d122ca7b1db45dfe3b62b5e8d0d5db /src/interface.c | |
| parent | 42cfb74c2bb82eb185962a17f848e47265a16316 (diff) | |
| download | powder-e1959c0c0bd2291232701b799ec1560c9962ff85.zip powder-e1959c0c0bd2291232701b799ec1560c9962ff85.tar.gz | |
Zoom toggle, alt+z
Diffstat (limited to 'src/interface.c')
| -rw-r--r-- | src/interface.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/interface.c b/src/interface.c index f84918e..9018888 100644 --- a/src/interface.c +++ b/src/interface.c @@ -2221,7 +2221,10 @@ int sdl_poll(void) sdl_caps = 1; if (event.key.keysym.sym=='z') { - sdl_zoom_trig = 1; + if (event.key.keysym.mod&KMOD_ALT)//toggle + sdl_zoom_trig = (!sdl_zoom_trig)*2; + else + sdl_zoom_trig = 1; } if ( event.key.keysym.sym == SDLK_PLUS) { @@ -2272,7 +2275,7 @@ int sdl_poll(void) sdl_rkey=event.key.keysym.sym; if (event.key.keysym.sym == SDLK_CAPSLOCK) sdl_caps = 0; - if (event.key.keysym.sym == 'z') + if (event.key.keysym.sym == 'z' && sdl_zoom_trig==1)//if ==2 then it was toggled with alt+z, don't turn off on keyup sdl_zoom_trig = 0; if (event.key.keysym.sym == SDLK_RIGHT || event.key.keysym.sym == SDLK_LEFT) { @@ -5092,7 +5095,7 @@ unsigned int decorations_ui(pixel *vid_buf,int *bsx,int *bsy, unsigned int saved if (sdl_wheel) { - if (sdl_zoom_trig==1)//zoom window change + if (sdl_zoom_trig)//zoom window change { ZSIZE += sdl_wheel; if (ZSIZE>60) @@ -5135,7 +5138,7 @@ unsigned int decorations_ui(pixel *vid_buf,int *bsx,int *bsy, unsigned int saved } } if (sdl_key==SDLK_LEFTBRACKET) { - if (sdl_zoom_trig==1) + if (sdl_zoom_trig) { ZSIZE -= 1; if (ZSIZE>60) @@ -5175,7 +5178,7 @@ unsigned int decorations_ui(pixel *vid_buf,int *bsx,int *bsy, unsigned int saved } } if (sdl_key==SDLK_RIGHTBRACKET) { - if (sdl_zoom_trig==1) + if (sdl_zoom_trig) { ZSIZE += 1; if (ZSIZE>60) |
