Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/input.cc8
-rw-r--r--src/client/playerview.cc4
-rw-r--r--src/client/worldview.cc1
3 files changed, 10 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) {
diff --git a/src/client/playerview.cc b/src/client/playerview.cc
index ca1d47e..a37cd73 100644
--- a/src/client/playerview.cc
+++ b/src/client/playerview.cc
@@ -240,6 +240,10 @@ void PlayerView::draw()
label_viewname->hide();
}
+ if (!map()->visible() && !chat()->visible()) {
+ view_hud->set_focus();
+ }
+
view_hud->show();
view_lastentity = 0;
}
diff --git a/src/client/worldview.cc b/src/client/worldview.cc
index cb46a17..7f13f45 100644
--- a/src/client/worldview.cc
+++ b/src/client/worldview.cc
@@ -108,6 +108,7 @@ void WorldView::draw()
view_mapbutton->hide();
} else {
view_playerview->show();
+ view_playerview->set_focus();
if (core::localcontrol()->state() == core::Entity::Docked) {
view_launchbutton->show();