From 03adf14fd0c16df0f674f1aa69fdbb45996328a4 Mon Sep 17 00:00:00 2001 From: tjw Date: Wed, 14 Feb 2007 23:29:19 +0000 Subject: * (bug 2741) Adds support in the SDL client for many keys that were not recognized. For example, F13, F14, F15, WINDOWS, SCROLLLOCK, CAPSLOCK, WORLD_0 - WORLD_95, etc. (Christophe Cavalaria) * (bug 2741) Adds the hard-coded toggleConsole bind Shift-Escape * (bug 2741) Adds detailed explaination of SDL keyboard handling differences in the README file. git-svn-id: svn://svn.icculus.org/quake3/trunk@1044 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/client/cl_keys.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++-- code/client/keycodes.h | 111 +++++++++++++++++++++++++++++++++++++++++++- code/client/keys.h | 2 +- code/unix/sdl_glimp.c | 27 ++++++++++- 4 files changed, 254 insertions(+), 8 deletions(-) (limited to 'code') diff --git a/code/client/cl_keys.c b/code/client/cl_keys.c index ed601be..acfe951 100644 --- a/code/client/cl_keys.c +++ b/code/client/cl_keys.c @@ -86,6 +86,9 @@ keyname_t keynames[] = {"F10", K_F10}, {"F11", K_F11}, {"F12", K_F12}, + {"F13", K_F13}, + {"F14", K_F14}, + {"F15", K_F15}, {"INS", K_INS}, {"DEL", K_DEL}, @@ -176,6 +179,116 @@ keyname_t keynames[] = {"SEMICOLON", ';'}, // because a raw semicolon seperates commands + {"WORLD_0", K_WORLD_0}, + {"WORLD_1", K_WORLD_1}, + {"WORLD_2", K_WORLD_2}, + {"WORLD_3", K_WORLD_3}, + {"WORLD_4", K_WORLD_4}, + {"WORLD_5", K_WORLD_5}, + {"WORLD_6", K_WORLD_6}, + {"WORLD_7", K_WORLD_7}, + {"WORLD_8", K_WORLD_8}, + {"WORLD_9", K_WORLD_9}, + {"WORLD_10", K_WORLD_10}, + {"WORLD_11", K_WORLD_11}, + {"WORLD_12", K_WORLD_12}, + {"WORLD_13", K_WORLD_13}, + {"WORLD_14", K_WORLD_14}, + {"WORLD_15", K_WORLD_15}, + {"WORLD_16", K_WORLD_16}, + {"WORLD_17", K_WORLD_17}, + {"WORLD_18", K_WORLD_18}, + {"WORLD_19", K_WORLD_19}, + {"WORLD_20", K_WORLD_20}, + {"WORLD_21", K_WORLD_21}, + {"WORLD_22", K_WORLD_22}, + {"WORLD_23", K_WORLD_23}, + {"WORLD_24", K_WORLD_24}, + {"WORLD_25", K_WORLD_25}, + {"WORLD_26", K_WORLD_26}, + {"WORLD_27", K_WORLD_27}, + {"WORLD_28", K_WORLD_28}, + {"WORLD_29", K_WORLD_29}, + {"WORLD_30", K_WORLD_30}, + {"WORLD_31", K_WORLD_31}, + {"WORLD_32", K_WORLD_32}, + {"WORLD_33", K_WORLD_33}, + {"WORLD_34", K_WORLD_34}, + {"WORLD_35", K_WORLD_35}, + {"WORLD_36", K_WORLD_36}, + {"WORLD_37", K_WORLD_37}, + {"WORLD_38", K_WORLD_38}, + {"WORLD_39", K_WORLD_39}, + {"WORLD_40", K_WORLD_40}, + {"WORLD_41", K_WORLD_41}, + {"WORLD_42", K_WORLD_42}, + {"WORLD_43", K_WORLD_43}, + {"WORLD_44", K_WORLD_44}, + {"WORLD_45", K_WORLD_45}, + {"WORLD_46", K_WORLD_46}, + {"WORLD_47", K_WORLD_47}, + {"WORLD_48", K_WORLD_48}, + {"WORLD_49", K_WORLD_49}, + {"WORLD_50", K_WORLD_50}, + {"WORLD_51", K_WORLD_51}, + {"WORLD_52", K_WORLD_52}, + {"WORLD_53", K_WORLD_53}, + {"WORLD_54", K_WORLD_54}, + {"WORLD_55", K_WORLD_55}, + {"WORLD_56", K_WORLD_56}, + {"WORLD_57", K_WORLD_57}, + {"WORLD_58", K_WORLD_58}, + {"WORLD_59", K_WORLD_59}, + {"WORLD_60", K_WORLD_60}, + {"WORLD_61", K_WORLD_61}, + {"WORLD_62", K_WORLD_62}, + {"WORLD_63", K_WORLD_63}, + {"WORLD_64", K_WORLD_64}, + {"WORLD_65", K_WORLD_65}, + {"WORLD_66", K_WORLD_66}, + {"WORLD_67", K_WORLD_67}, + {"WORLD_68", K_WORLD_68}, + {"WORLD_69", K_WORLD_69}, + {"WORLD_70", K_WORLD_70}, + {"WORLD_71", K_WORLD_71}, + {"WORLD_72", K_WORLD_72}, + {"WORLD_73", K_WORLD_73}, + {"WORLD_74", K_WORLD_74}, + {"WORLD_75", K_WORLD_75}, + {"WORLD_76", K_WORLD_76}, + {"WORLD_77", K_WORLD_77}, + {"WORLD_78", K_WORLD_78}, + {"WORLD_79", K_WORLD_79}, + {"WORLD_80", K_WORLD_80}, + {"WORLD_81", K_WORLD_81}, + {"WORLD_82", K_WORLD_82}, + {"WORLD_83", K_WORLD_83}, + {"WORLD_84", K_WORLD_84}, + {"WORLD_85", K_WORLD_85}, + {"WORLD_86", K_WORLD_86}, + {"WORLD_87", K_WORLD_87}, + {"WORLD_88", K_WORLD_88}, + {"WORLD_89", K_WORLD_89}, + {"WORLD_90", K_WORLD_90}, + {"WORLD_91", K_WORLD_91}, + {"WORLD_92", K_WORLD_92}, + {"WORLD_93", K_WORLD_93}, + {"WORLD_94", K_WORLD_94}, + {"WORLD_95", K_WORLD_95}, + + {"WINDOWS", K_SUPER}, + {"COMPOSE", K_COMPOSE}, + {"MODE", K_MODE}, + {"HELP", K_HELP}, + {"PRINT", K_PRINT}, + {"SYSREQ", K_SYSREQ}, + {"SCROLLOCK", K_SCROLLOCK }, + {"BREAK", K_BREAK}, + {"MENU", K_MENU}, + {"POWER", K_POWER}, + {"EURO", K_EURO}, + {"UNDO", K_UNDO}, + {NULL,0} }; @@ -751,7 +864,7 @@ char *Key_KeynumToString( int keynum ) { return ""; } - if ( keynum < 0 || keynum > 255 ) { + if ( keynum < 0 || keynum >= MAX_KEYS ) { return ""; } @@ -936,7 +1049,7 @@ void Key_WriteBindings( fileHandle_t f ) { FS_Printf (f, "unbindall\n" ); - for (i=0 ; i<256 ; i++) { + for (i=0 ; isym >= SDLK_WORLD_0 && keysym->sym <= SDLK_WORLD_95) + *key = (keysym->sym - SDLK_WORLD_0) + K_WORLD_0; + break; } if( keysym->unicode <= 127 ) // maps to ASCII? -- cgit v1.2.3