From 5b94df1df2707b36401d91d80b92d0e4cdfd2277 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 5 Jun 2009 21:09:28 +0000 Subject: fix playerview keyboard events --- src/client/input.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/client/input.cc') diff --git a/src/client/input.cc b/src/client/input.cc index 943bed1..ee4a789 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -517,8 +517,6 @@ void key_pressed(Key *key) if (ui::root()->input_key(true, Keyboard::translate_keysym(key->sym(), keyboard_modifiers), keyboard_modifiers)) { - // work-around for the mouse release event FIXME - //key->key_pressed = 0; return; } else if (!core::localplayer()->view() && core::application()->connected() && core::localcontrol()) { @@ -687,6 +685,7 @@ void frame() SDL_Event event; Key *key = 0; bool pressed = false; + bool mouse_moved = false; if (last_key_time + 1.0f < client()->time()) { last_key = 0; @@ -706,8 +705,8 @@ void frame() case SDL_MOUSEMOTION: mouse_x = event.motion.x; mouse_y = event.motion.y; + mouse_moved = true; mouse_lastmoved = client()->time(); - ui::root()->input_mouse((float) mouse_x, (float) mouse_y); break; case SDL_MOUSEBUTTONDOWN: @@ -764,6 +763,9 @@ void frame() } } + if (mouse_moved) + ui::root()->input_mouse((float) mouse_x, (float) mouse_y); + /* -- handle key repeat --------------------------- */ float delay = 200.0f; // key delay time-out in milliseconds if (input_keydelay) { -- cgit v1.2.3