Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-06-05 21:09:28 +0000
committerStijn Buys <ingar@osirion.org>2009-06-05 21:09:28 +0000
commit5b94df1df2707b36401d91d80b92d0e4cdfd2277 (patch)
treeba18980848c5fcc6d768d35d6cba8c84547d37f1 /src/client/input.cc
parenta0cb9f0208b5ecdffdd9328d5305ed99e7cbd5e6 (diff)
fix playerview keyboard events
Diffstat (limited to 'src/client/input.cc')
-rw-r--r--src/client/input.cc8
1 files changed, 5 insertions, 3 deletions
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) {