summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-02-20 22:38:19 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2011-02-20 22:47:08 (GMT)
commitac7eda80a545ba8c0cbab80236df88570e1d33ad (patch)
treed6975549efb00f8d06c649e224c873444202be86
parent317ddab6176b2727673e9b1fefbd05a8539d1f2b (diff)
downloadpowder-ac7eda80a545ba8c0cbab80236df88570e1d33ad.zip
powder-ac7eda80a545ba8c0cbab80236df88570e1d33ad.tar.gz
Zoom key conflict with international keyboards
Change zoom key to only use keysym.sym, like all the other keyboard controls. This may mean it is no longer the 'z' key on all systems, but will prevent it conflicting with the other keyboard controls.
-rw-r--r--includes/interface.h2
-rw-r--r--src/interface.c7
-rw-r--r--src/main.c2
3 files changed, 3 insertions, 8 deletions
diff --git a/includes/interface.h b/includes/interface.h
index e1d7e6f..a49f75f 100644
--- a/includes/interface.h
+++ b/includes/interface.h
@@ -154,8 +154,6 @@ extern char search_expr[256];
extern char *tag_names[TAG_MAX];
extern int tag_votes[TAG_MAX];
-extern int Z_keysym;
-
extern int zoom_en;
extern int zoom_x, zoom_y;
extern int zoom_wx, zoom_wy;
diff --git a/src/interface.c b/src/interface.c
index 1f2f8fd..12f13f6 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -60,8 +60,6 @@ char search_expr[256] = "";
char *tag_names[TAG_MAX];
int tag_votes[TAG_MAX];
-int Z_keysym = 'z';
-
int zoom_en = 0;
int zoom_x=(XRES-ZSIZE_D)/2, zoom_y=(YRES-ZSIZE_D)/2;
int zoom_wx=0, zoom_wy=0;
@@ -1763,10 +1761,9 @@ int sdl_poll(void)
sdl_ascii=event.key.keysym.unicode;
if (event.key.keysym.sym == SDLK_CAPSLOCK)
sdl_caps = 1;
- if (event.key.keysym.unicode=='z' || event.key.keysym.unicode=='Z')
+ if (event.key.keysym.sym=='z')
{
sdl_zoom_trig = 1;
- Z_keysym = event.key.keysym.sym;
}
if ( event.key.keysym.sym == SDLK_PLUS)
{
@@ -1816,7 +1813,7 @@ int sdl_poll(void)
case SDL_KEYUP:
if (event.key.keysym.sym == SDLK_CAPSLOCK)
sdl_caps = 0;
- if (event.key.keysym.sym == Z_keysym)
+ if (event.key.keysym.sym == 'z')
sdl_zoom_trig = 0;
if (event.key.keysym.sym == SDLK_RIGHT || event.key.keysym.sym == SDLK_LEFT)
{
diff --git a/src/main.c b/src/main.c
index 32a89dd..9fcebfb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2118,7 +2118,7 @@ int main(int argc, char *argv[])
if (!sdl_zoom_trig && zoom_en==1)
zoom_en = 0;
- if (sdl_key==Z_keysym && zoom_en==2)
+ if (sdl_key=='z' && zoom_en==2)
zoom_en = 1;
if (load_mode)