From 83d6c17799c4d448a67ab5cdad02954282fa5c94 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 1 Nov 2008 13:33:18 +0000 Subject: server-side model loading, initial @dock function --- src/client/input.cc | 10 ++++++++-- src/client/keyboard.cc | 19 +++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'src/client') diff --git a/src/client/input.cc b/src/client/input.cc index 7188de0..d4ccb17 100644 --- a/src/client/input.cc +++ b/src/client/input.cc @@ -482,6 +482,8 @@ Key::Modifier convert_SDL_modifier(int const sdlmodifier) void key_pressed(Key *key) { + // FIXME implement a real 'console key' + if (key->bind(Key::None).compare("ui_console") == 0) { // FIXME bah local_direction = 0.0f; @@ -510,10 +512,14 @@ void key_pressed(Key *key) } else if (core::application()->connected() && core::localcontrol()) { char c = key->bind(convert_SDL_modifier(keyboard_modifiers)).c_str()[0]; - if (c == '+') { + if (c == '@') { + // target bind + if (targets::current_id()) + core::cmd() << key->bind(convert_SDL_modifier(keyboard_modifiers)) << " " << targets::current_id() <<"\n"; + } else if (c == '+') { // action bind action_press(key, key->bind(convert_SDL_modifier(keyboard_modifiers))); - } else if (c) { + } else { // normal bind core::cmd() << key->bind(convert_SDL_modifier(keyboard_modifiers)) << "\n"; } diff --git a/src/client/keyboard.cc b/src/client/keyboard.cc index b4b0e3a..a29b601 100644 --- a/src/client/keyboard.cc +++ b/src/client/keyboard.cc @@ -30,8 +30,7 @@ Keyboard::Keyboard() // ------------------ ACTIONS - // note: actions should be state keys and not use key repeat - // FIXME: thruster should be a state key + // FIXME actions should be state keys and not use key repeat add_action("+left", Action::None, "rotate left"); add_action("+right", Action::None, "rotate right"); @@ -57,13 +56,17 @@ Keyboard::Keyboard() add_action("+control", Action::None, "enable mouse control while pressed"); + // TODO the @ is a hack for functions that take the current entity as param + + add_action("@dock", Action::None, "send docking request to target"); + // ------------------ KEYS Key *key = 0; add_key("backspace", SDLK_BACKSPACE); add_key("tab", SDLK_TAB, 0, "impulse"); add_key("clear", SDLK_CLEAR); - key = add_key("enter", SDLK_RETURN); + key = add_key("enter", SDLK_RETURN, 0, "ui_chat"); key->assign(Key::Alt, "toggle r_fullscreen"); add_key("pause", SDLK_PAUSE); add_key("esc", SDLK_ESCAPE); @@ -147,13 +150,13 @@ Keyboard::Keyboard() add_key("kp4", SDLK_KP4, 0, "+left"); add_key("kp5", SDLK_KP5); add_key("kp6", SDLK_KP6, 0, "+right"); - add_key("kp7", SDLK_KP7); + add_key("kp7", SDLK_KP7, 0, "+rollleft"); add_key("kp8", SDLK_KP8, 0, "+down"); - add_key("kp9", SDLK_KP9); + add_key("kp9", SDLK_KP9, 0, "+rollright"); add_key("kpperiod", SDLK_KP_PERIOD, '.'); - add_key("kpdiv", SDLK_KP_DIVIDE, '/', "+rollleft"); - add_key("kpmul", SDLK_KP_MULTIPLY, '*', "+rollright"); + add_key("kpdiv", SDLK_KP_DIVIDE, '/'); + add_key("kpmul", SDLK_KP_MULTIPLY, '*'); add_key("kpmin", SDLK_KP_MINUS, '-', "+thrustdown"); add_key("kpplus", SDLK_KP_PLUS, '+', "+thrustup"); add_key("kpenter", SDLK_KP_ENTER, '\n', "ui_chat"); @@ -172,7 +175,7 @@ Keyboard::Keyboard() add_key("f1", SDLK_F1); add_key("f2", SDLK_F2); - add_key("f3", SDLK_F3); + add_key("f3", SDLK_F3, 0, "@dock"); key = add_key("f4", SDLK_F4); #ifdef _WIN32 key->assign(Key::Alt, "quit"); -- cgit v1.2.3