diff --git a/Quake/keys.c b/Quake/keys.c index 92074032..a35385b4 100644 --- a/Quake/keys.c +++ b/Quake/keys.c @@ -119,6 +119,8 @@ keyname_t keynames[] = {"MOUSE1", K_MOUSE1}, {"MOUSE2", K_MOUSE2}, {"MOUSE3", K_MOUSE3}, + {"MOUSE4", K_MOUSE4}, + {"MOUSE5", K_MOUSE5}, {"JOY1", K_JOY1}, {"JOY2", K_JOY2}, diff --git a/Quake/keys.h b/Quake/keys.h index 35841ed4..4ae71705 100644 --- a/Quake/keys.h +++ b/Quake/keys.h @@ -139,6 +139,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define K_MWHEELUP 239 #define K_MWHEELDOWN 240 +// thumb buttons +#define K_MOUSE4 241 +#define K_MOUSE5 242 + typedef enum {key_game, key_console, key_message, key_menu} keydest_t; diff --git a/Quake/main_sdl.c b/Quake/main_sdl.c index 77e65e2b..9e562111 100644 --- a/Quake/main_sdl.c +++ b/Quake/main_sdl.c @@ -130,6 +130,12 @@ int main(int argc, char *argv[]) case SDL_BUTTON_WHEELDOWN: Key_Event(K_MWHEELDOWN, event.button.type == SDL_MOUSEBUTTONDOWN); break; + case SDL_BUTTON_X1: + Key_Event(K_MOUSE4, event.button.type == SDL_MOUSEBUTTONDOWN); + break; + case SDL_BUTTON_X2: + Key_Event(K_MOUSE5, event.button.type == SDL_MOUSEBUTTONDOWN); + break; } break; case SDL_KEYDOWN: