From 6a1766f8cedb18ab2caefac30c845f63aa2e8d19 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Wed, 21 Jan 2009 23:12:56 +0000 Subject: [PATCH] fixed mouse buttons that I kinda fucked up --- src/engine/client/ec_inp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/engine/client/ec_inp.c b/src/engine/client/ec_inp.c index 29a5a74ec..6aae34fc3 100644 --- a/src/engine/client/ec_inp.c +++ b/src/engine/client/ec_inp.c @@ -166,6 +166,17 @@ void inp_update() mem_copy(input_state[input_current], state, i); } + /* these states must always be updated manually because they are not in the GetKeyState from SDL */ + i = SDL_GetMouseState(NULL, NULL); + if(i&SDL_BUTTON(1)) input_state[input_current][KEY_MOUSE_1] = 1; /* 1 is left */ + if(i&SDL_BUTTON(3)) input_state[input_current][KEY_MOUSE_2] = 1; /* 3 is right */ + if(i&SDL_BUTTON(2)) input_state[input_current][KEY_MOUSE_3] = 1; /* 2 is middle */ + if(i&SDL_BUTTON(4)) input_state[input_current][KEY_MOUSE_4] = 1; + if(i&SDL_BUTTON(5)) input_state[input_current][KEY_MOUSE_5] = 1; + if(i&SDL_BUTTON(6)) input_state[input_current][KEY_MOUSE_6] = 1; + if(i&SDL_BUTTON(7)) input_state[input_current][KEY_MOUSE_7] = 1; + if(i&SDL_BUTTON(8)) input_state[input_current][KEY_MOUSE_8] = 1; + { SDL_Event event;