diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-21 18:54:02 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-10-21 18:54:02 +0000 |
| commit | 58601cda36f30dc8e9274e753b9146be711bc79d (patch) | |
| tree | 88df7424eef1e742c33a8d65807dc6272578b43f | |
| parent | 66579c87a21de9d155f6643ad35d3af2ffd2edcb (diff) | |
| download | zcatch-58601cda36f30dc8e9274e753b9146be711bc79d.tar.gz zcatch-58601cda36f30dc8e9274e753b9146be711bc79d.zip | |
fixed double clicking
| -rw-r--r-- | src/engine/client/ec_inp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/engine/client/ec_inp.c b/src/engine/client/ec_inp.c index cf037bb0..c3ab63b7 100644 --- a/src/engine/client/ec_inp.c +++ b/src/engine/client/ec_inp.c @@ -20,11 +20,12 @@ static unsigned char input_state[2][1024] = {{0}, {0}}; static int input_current = 0; #ifdef CONFIG_NO_SDL -static unsigned int last_release = 0; #else static int input_grabbed = 0; static int input_use_grab = 0; #endif + +static unsigned int last_release = 0; static unsigned int release_delta = -1; void inp_mouse_relative(int *x, int *y) @@ -336,6 +337,13 @@ void inp_update() /* handle mouse buttons */ case SDL_MOUSEBUTTONUP: action = INPFLAG_RELEASE; + + if(event.button.button == 1) key = KEY_MOUSE_1; + { + release_delta = time_get() - last_release; + last_release = time_get(); + } + case SDL_MOUSEBUTTONDOWN: if(event.button.button == 1) key = KEY_MOUSE_1; if(event.button.button == 3) key = KEY_MOUSE_2; |