From f54bd48a884e4e3c95818f042a4b2418a6e070a4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 7 Oct 2008 17:14:27 +0000 Subject: working button click --- src/client/input.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/client/input.cc') 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: -- cgit v1.2.3