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>2008-10-07 17:14:27 +0000
committerStijn Buys <ingar@osirion.org>2008-10-07 17:14:27 +0000
commitf54bd48a884e4e3c95818f042a4b2418a6e070a4 (patch)
tree73e82729a2f97b58e94ffd6944ac1ad47bf8314e /src/client/input.cc
parentf8d1ee921c83b7b148883b3ee16e4ec9c776d6db (diff)
working button click
Diffstat (limited to 'src/client/input.cc')
-rw-r--r--src/client/input.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/input.cc b/src/client/input.cc
index d6f83f9..41f79fe 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -527,6 +527,9 @@ void key_pressed(Key *key)
if (key->sym() < 512)
console()->keypressed(translate_keysym(key->sym(), keyboard_modifiers));
+ } else if (ui::root()->active()) {
+ ui::root()->event_keypress(key->sym(), keyboard_modifiers);
+
} else if (chat::visible()) {
// send key events to the chat box
if (key->sym() < 512)
@@ -555,6 +558,10 @@ void key_pressed(Key *key)
void key_released(Key *key)
{
+ if (ui::root()->active()) {
+ ui::root()->event_keyrelease(key->sym(), keyboard_modifiers);
+ }
+
if (core::application()->connected() && core::localcontrol()) {
if ((key->sym() == 512 + SDL_BUTTON_LEFT) && targets::hover() && (key->waspressed() <= (input_mousedelay->value()/1000.0f) ) ) {
@@ -707,7 +714,7 @@ void frame(float seconds)
mouse_x = event.motion.x;
mouse_y = event.motion.y;
mouse_lastmoved = client()->time();
- ui::root()->set_mouse_cursor((float) mouse_x, (float) mouse_y);
+ ui::root()->event_mousecursor((float) mouse_x, (float) mouse_y);
break;
case SDL_MOUSEBUTTONDOWN: