diff options
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/client/components/binds.cpp | 11 | ||||
| -rw-r--r-- | src/game/client/components/chat.cpp | 4 | ||||
| -rw-r--r-- | src/game/client/components/console.cpp | 4 | ||||
| -rw-r--r-- | src/game/client/components/menus.cpp | 8 | ||||
| -rw-r--r-- | src/game/client/components/menus_settings.cpp | 2 | ||||
| -rw-r--r-- | src/game/client/components/motd.cpp | 2 | ||||
| -rw-r--r-- | src/game/client/lineinput.cpp | 2 | ||||
| -rw-r--r-- | src/game/editor/ed_editor.cpp | 28 | ||||
| -rw-r--r-- | src/game/editor/ed_popups.cpp | 2 |
9 files changed, 27 insertions, 36 deletions
diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index de5f4f05..68f76f35 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -87,13 +87,9 @@ void BINDS::set_defaults() bind(KEY_TAB, "+scoreboard"); bind(KEY_F10, "screenshot"); -#ifdef CONFIG_NO_SDL - bind('A', "+left"); - bind('D', "+right"); -#else bind('a', "+left"); bind('d', "+right"); -#endif + bind(KEY_SPACE, "+jump"); bind(KEY_MOUSE_1, "+fire"); bind(KEY_MOUSE_2, "+hook"); @@ -108,13 +104,8 @@ void BINDS::set_defaults() bind(KEY_MOUSE_WHEEL_UP, "+prevweapon"); bind(KEY_MOUSE_WHEEL_DOWN, "+nextweapon"); -#ifdef CONFIG_NO_SDL - bind('T', "chat all"); - bind('Y', "chat team"); -#else bind('t', "chat all"); bind('y', "chat team"); -#endif bind(KEY_F3, "vote yes"); bind(KEY_F4, "vote no"); diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 998ba6ed..e58814cb 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -51,9 +51,9 @@ bool CHAT::on_input(INPUT_EVENT e) if(mode == MODE_NONE) return false; - if(e.flags&INPFLAG_PRESS && e.key == KEY_ESC) + if(e.flags&INPFLAG_PRESS && e.key == KEY_ESCAPE) mode = MODE_NONE; - else if(e.flags&INPFLAG_PRESS && (e.key == KEY_ENTER || e.key == KEY_KP_ENTER)) + else if(e.flags&INPFLAG_PRESS && (e.key == KEY_RETURN || e.key == KEY_KP_ENTER)) { if(input.get_string()[0]) gameclient.chat->say(mode == MODE_ALL ? 0 : 1, input.get_string()); diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index ab0c9aae..9efebd92 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -61,7 +61,7 @@ void CONSOLE::INSTANCE::on_input(INPUT_EVENT e) if(e.flags&INPFLAG_PRESS) { - if(e.key == KEY_ENTER || e.key == KEY_KP_ENTER) + if(e.key == KEY_RETURN || e.key == KEY_KP_ENTER) { if(input.get_string()[0]) { @@ -298,7 +298,7 @@ bool CONSOLE::on_input(INPUT_EVENT e) if(e.key >= KEY_F1 && e.key <= KEY_F15) return false; - if(e.key == KEY_ESC && (e.flags&INPFLAG_PRESS)) + if(e.key == KEY_ESCAPE && (e.flags&INPFLAG_PRESS)) toggle(console_type); else current_console()->on_input(e); diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index e4351260..f1830308 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -259,12 +259,12 @@ int MENUS::ui_do_edit_box(void *id, const RECT *rect, char *str, int str_size, f at_index--; r = 1; } - else if (k == KEY_DEL && at_index < len) + else if (k == KEY_DELETE && at_index < len) { memmove(str + at_index, str + at_index + 1, len - at_index); r = 1; } - else if (k == KEY_ENTER) + else if (k == KEY_RETURN) ui_clear_last_active_item(); else if (k == KEY_LEFT && at_index > 0) at_index--; @@ -933,7 +933,7 @@ bool MENUS::on_input(INPUT_EVENT e) // special handle esc and enter for popup purposes if(e.flags&INPFLAG_PRESS) { - if(e.key == KEY_ESC) + if(e.key == KEY_ESCAPE) { escape_pressed = true; set_active(!is_active()); @@ -944,7 +944,7 @@ bool MENUS::on_input(INPUT_EVENT e) if(is_active()) { // special for popups - if(e.flags&INPFLAG_PRESS || e.key == KEY_ENTER) + if(e.flags&INPFLAG_PRESS || e.key == KEY_RETURN) enter_pressed = true; if(num_inputevents < MAX_INPUTEVENTS) diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp index c536753c..c461b542 100644 --- a/src/game/client/components/menus_settings.cpp +++ b/src/game/client/components/menus_settings.cpp @@ -30,7 +30,7 @@ bool MENUS_KEYBINDER::on_input(INPUT_EVENT e) { if(take_key) { - if(e.flags&INPFLAG_PRESS && e.key != KEY_ESC) + if(e.flags&INPFLAG_PRESS && e.key != KEY_ESCAPE) { key = e; got_key = true; diff --git a/src/game/client/components/motd.cpp b/src/game/client/components/motd.cpp index 19693390..3b8f2243 100644 --- a/src/game/client/components/motd.cpp +++ b/src/game/client/components/motd.cpp @@ -77,7 +77,7 @@ void MOTD::on_message(int msgtype, void *rawmsg) bool MOTD::on_input(INPUT_EVENT e) { - if(is_active() && e.flags&INPFLAG_PRESS && e.key == KEY_ESC) + if(is_active() && e.flags&INPFLAG_PRESS && e.key == KEY_ESCAPE) { clear(); return true; diff --git a/src/game/client/lineinput.cpp b/src/game/client/lineinput.cpp index 7a02d1f9..7ec22d4e 100644 --- a/src/game/client/lineinput.cpp +++ b/src/game/client/lineinput.cpp @@ -48,7 +48,7 @@ void LINEINPUT::process_input(INPUT_EVENT e) cursor_pos--; len--; } - else if (k == KEY_DEL && cursor_pos < len) + else if (k == KEY_DELETE && cursor_pos < len) { memmove(str + cursor_pos, str + cursor_pos + 1, len - cursor_pos); len--; diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp index 08bb4401..f62d738e 100644 --- a/src/game/editor/ed_editor.cpp +++ b/src/game/editor/ed_editor.cpp @@ -234,9 +234,9 @@ int ui_do_edit_box(void *id, const RECT *rect, char *str, int str_size, float fo memmove(str + at_index - 1, str + at_index, len - at_index + 1); at_index--; } - else if (k == KEY_DEL && at_index < len) + else if (k == KEY_DELETE && at_index < len) memmove(str + at_index, str + at_index + 1, len - at_index); - else if (k == KEY_ENTER) + else if (k == KEY_RETURN) ui_clear_last_active_item(); else if (k == KEY_LEFT && at_index > 0) at_index--; @@ -543,18 +543,18 @@ static void do_toolbar(RECT toolbar) RECT button; // ctrl+o to open - if(inp_key_down('O') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL))) + if(inp_key_down('o') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL))) editor.invoke_file_dialog(LISTDIRTYPE_ALL, "Open Map", "Open", "maps/", "", callback_open_map); // ctrl+s to save - if(inp_key_down('S') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL))) + if(inp_key_down('s') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL))) editor.invoke_file_dialog(LISTDIRTYPE_SAVE, "Save Map", "Save", "maps/", "", callback_save_map); // animate button ui_vsplit_l(&toolbar, 30.0f, &button, &toolbar); static int hq_button = 0; if(do_editor_button(&hq_button, "Detail", editor.show_detail, &button, draw_editor_button, 0, "[ctrl+h] Toggle High Detail") || - (inp_key_down('H') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL)))) + (inp_key_down('h') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL)))) { editor.show_detail = !editor.show_detail; } @@ -564,7 +564,7 @@ static void do_toolbar(RECT toolbar) ui_vsplit_l(&toolbar, 30.0f, &button, &toolbar); static int animate_button = 0; if(do_editor_button(&animate_button, "Anim", editor.animate, &button, draw_editor_button, 0, "[ctrl+m] Toggle animation") || - (inp_key_down('M') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL)))) + (inp_key_down('m') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL)))) { editor.animate_start = time_get(); editor.animate = !editor.animate; @@ -576,7 +576,7 @@ static void do_toolbar(RECT toolbar) ui_vsplit_l(&toolbar, 30.0f, &button, &toolbar); static int proof_button = 0; if(do_editor_button(&proof_button, "Proof", editor.proof_borders, &button, draw_editor_button, 0, "[ctrl-p] Toggles proof borders. These borders represent what a player maximum can see.") || - (inp_key_down('P') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL)))) + (inp_key_down('p') && (inp_key_pressed(KEY_LCTRL) || inp_key_pressed(KEY_RCTRL)))) { editor.proof_borders = !editor.proof_borders; } @@ -586,7 +586,7 @@ static void do_toolbar(RECT toolbar) // zoom group ui_vsplit_l(&toolbar, 16.0f, &button, &toolbar); static int zoom_out_button = 0; - if(do_editor_button(&zoom_out_button, "ZO", 0, &button, draw_editor_button_l, 0, "[NumPad-] Zoom out") || inp_key_down(KEY_KP_SUBTRACT)) + if(do_editor_button(&zoom_out_button, "ZO", 0, &button, draw_editor_button_l, 0, "[NumPad-] Zoom out") || inp_key_down(KEY_KP_MINUS)) editor.zoom_level += 50; ui_vsplit_l(&toolbar, 16.0f, &button, &toolbar); @@ -600,7 +600,7 @@ static void do_toolbar(RECT toolbar) ui_vsplit_l(&toolbar, 16.0f, &button, &toolbar); static int zoom_in_button = 0; - if(do_editor_button(&zoom_in_button, "ZI", 0, &button, draw_editor_button_r, 0, "[NumPad+] Zoom in") || inp_key_down(KEY_KP_ADD)) + if(do_editor_button(&zoom_in_button, "ZI", 0, &button, draw_editor_button_r, 0, "[NumPad+] Zoom in") || inp_key_down(KEY_KP_PLUS)) editor.zoom_level -= 50; if(inp_key_presses(KEY_MOUSE_WHEEL_UP)) @@ -623,7 +623,7 @@ static void do_toolbar(RECT toolbar) // flip buttons ui_vsplit_l(&toolbar, 20.0f, &button, &toolbar); static int flipx_button = 0; - if(do_editor_button(&flipx_button, "^X", enabled, &button, draw_editor_button_l, 0, "[N] Flip brush horizontal") || inp_key_down('N')) + if(do_editor_button(&flipx_button, "^X", enabled, &button, draw_editor_button_l, 0, "[N] Flip brush horizontal") || inp_key_down('n')) { for(int i = 0; i < brush.layers.len(); i++) brush.layers[i]->brush_flip_x(); @@ -631,7 +631,7 @@ static void do_toolbar(RECT toolbar) ui_vsplit_l(&toolbar, 20.0f, &button, &toolbar); static int flipy_button = 0; - if(do_editor_button(&flipy_button, "^Y", enabled, &button, draw_editor_button_r, 0, "[M] Flip brush vertical") || inp_key_down('M')) + if(do_editor_button(&flipy_button, "^Y", enabled, &button, draw_editor_button_r, 0, "[M] Flip brush vertical") || inp_key_down('m')) { for(int i = 0; i < brush.layers.len(); i++) brush.layers[i]->brush_flip_y(); @@ -647,7 +647,7 @@ static void do_toolbar(RECT toolbar) ui_vsplit_l(&toolbar, 5.0f, &button, &toolbar); ui_vsplit_l(&toolbar, 30.0f, &button, &toolbar); static int ccw_button = 0; - if(do_editor_button(&ccw_button, "CCW", enabled, &button, draw_editor_button_l, 0, "[R] Rotates the brush counter clockwise") || inp_key_down('R')) + if(do_editor_button(&ccw_button, "CCW", enabled, &button, draw_editor_button_l, 0, "[R] Rotates the brush counter clockwise") || inp_key_down('r')) { for(int i = 0; i < brush.layers.len(); i++) brush.layers[i]->brush_rotate(-rotation_amount/360.0f*pi*2); @@ -655,7 +655,7 @@ static void do_toolbar(RECT toolbar) ui_vsplit_l(&toolbar, 30.0f, &button, &toolbar); static int cw_button = 0; - if(do_editor_button(&cw_button, "CW", enabled, &button, draw_editor_button_r, 0, "[T] Rotates the brush clockwise") || inp_key_down('T')) + if(do_editor_button(&cw_button, "CW", enabled, &button, draw_editor_button_r, 0, "[T] Rotates the brush clockwise") || inp_key_down('t')) { for(int i = 0; i < brush.layers.len(); i++) brush.layers[i]->brush_rotate(rotation_amount/360.0f*pi*2); @@ -1853,7 +1853,7 @@ static void render_file_dialog() ui_vsplit_r(&buttonbar, 40.0f, &buttonbar, &button); ui_vsplit_r(&buttonbar, 50.0f, &buttonbar, &button); - if(do_editor_button(&cancel_button, "Cancel", 0, &button, draw_editor_button, 0, 0) || inp_key_pressed(KEY_ESC)) + if(do_editor_button(&cancel_button, "Cancel", 0, &button, draw_editor_button, 0, 0) || inp_key_pressed(KEY_ESCAPE)) editor.dialog = DIALOG_NONE; } diff --git a/src/game/editor/ed_popups.cpp b/src/game/editor/ed_popups.cpp index 813dfd50..13bfe243 100644 --- a/src/game/editor/ed_popups.cpp +++ b/src/game/editor/ed_popups.cpp @@ -63,7 +63,7 @@ void ui_do_popup_menu() if(ui_popups[i].func(r)) ui_num_popups--; - if(inp_key_down(KEY_ESC)) + if(inp_key_down(KEY_ESCAPE)) ui_num_popups--; } } |