--- TSC-git-92d74ff7f.old/tsc/src/gui/menu.cpp +++ TSC-git-92d74ff7f/tsc/src/gui/menu.cpp @@ -314,6 +314,34 @@ m_handler->Set_Active(m_handler->m_active - 1); } } + // End and PgDn keys + else if ((evt.key.code == sf::Keyboard::End ) || + (evt.key.code == sf::Keyboard::PageDown )) + { + int nn = m_handler->Get_Size() - 1; + +//-------------------------------------------------------------------- + +// The following "if" statement is a kludge. It's intended to change +// the behavior of the End and PgDn keys on the main and Load/Save +// menus. Specifically, this code tries to make End (or PgDn) jump to +// the last "real" item on each menu (as opposed to items that are +// located elsewhere, such as "Credits"). If the structure of either +// menu is changed in the future, this code will need to be modified +// accordingly. + + if ((nn == 5) || (nn == 9)) nn--; + +//-------------------------------------------------------------------- + + m_handler->Set_Active (nn); + } + // Home and PgUp keys + else if ((evt.key.code == sf::Keyboard::Home ) || + (evt.key.code == sf::Keyboard::PageUp )) + { + m_handler->Set_Active (0); + } // Activate Button else if (evt.key.code == sf::Keyboard::Return) { if (m_menu_data) { --- TSC-git-92d74ff7f.old/tsc/src/input/keyboard.cpp +++ TSC-git-92d74ff7f/tsc/src/input/keyboard.cpp @@ -213,7 +213,8 @@ } } // take a screenshot - else if (evt.key.code == pPreferences->m_key_screenshot) { + else if ((evt.key.code == pPreferences->m_key_screenshot) || + (evt.key.code == sf::Keyboard::F5)) { pVideo->Save_Screenshot(); } // pause the game --- TSC-git-92d74ff7f.old/tsc/src/level/level.cpp +++ TSC-git-92d74ff7f/tsc/src/level/level.cpp @@ -780,13 +780,17 @@ pLevel_Player->Action_Shoot(); } // Jump - else if (evt.key.code == pPreferences->m_key_jump && !editor_enabled) { + else if (((evt.key.code == pPreferences->m_key_jump) || + (evt.key.code == sf::Keyboard::S)) && + !editor_enabled) { Scripting::cKeyDown_Event evt("jump"); evt.Fire(m_mruby, pKeyboard); pLevel_Player->Action_Jump(); } // Action - else if (evt.key.code == pPreferences->m_key_action && !editor_enabled) { + else if (((evt.key.code == pPreferences->m_key_action) || + (evt.key.code == sf::Keyboard::A)) && + !editor_enabled) { Scripting::cKeyDown_Event evt("action"); evt.Fire(m_mruby, pKeyboard); pLevel_Player->Action_Interact(INP_ACTION); @@ -857,13 +861,15 @@ else if (evt.key.code == pPreferences->m_key_down) { pLevel_Player->Action_Stop_Interact(INP_DOWN); } - else if (evt.key.code == pPreferences->m_key_jump) { + else if ((evt.key.code == pPreferences->m_key_jump) || + (evt.key.code == sf::Keyboard::S)) { pLevel_Player->Action_Stop_Interact(INP_JUMP); } else if (evt.key.code == pPreferences->m_key_shoot) { pLevel_Player->Action_Stop_Interact(INP_SHOOT); } - else if (evt.key.code == pPreferences->m_key_action) { + else if ((evt.key.code == pPreferences->m_key_action) || + (evt.key.code == sf::Keyboard::A)) { pLevel_Player->Action_Stop_Interact(INP_ACTION); } else { --- TSC-git-92d74ff7f.old/tsc/src/level/level_player.cpp +++ TSC-git-92d74ff7f/tsc/src/level/level_player.cpp @@ -289,7 +291,8 @@ if (input_event.key.code == sf::Keyboard::Escape) { goto animation_end; } - else if (input_event.key.code == pPreferences->m_key_screenshot) { + else if ((input_event.key.code == pPreferences->m_key_screenshot) || + (input_event.key.code == sf::Keyboard::F5)) { pVideo->Save_Screenshot(); } } @@ -321,7 +324,8 @@ if (input_event.key.code == sf::Keyboard::Escape) { goto animation_end; } - else if (input_event.key.code == pPreferences->m_key_screenshot) { + else if ((input_event.key.code == pPreferences->m_key_screenshot) || + (input_event.key.code == sf::Keyboard::F5)) { pVideo->Save_Screenshot(); } } @@ -385,7 +389,8 @@ for (i = 10.0f; i > 0.0f; i -= 0.011f * pFramerate->m_speed_factor) { while (pVideo->PollEvent(input_event)) { if (input_event.type == sf::Event::KeyPressed) { - if (input_event.key.code == pPreferences->m_key_screenshot) { + if ((input_event.key.code == pPreferences->m_key_screenshot) || + (input_event.key.code == sf::Keyboard::F5)) { pVideo->Save_Screenshot(); } } @@ -394,7 +399,11 @@ // TODO: Why is the below not simply handled as events in the above event loop? // Escape stops - if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape) || sf::Keyboard::isKeyPressed(sf::Keyboard::Return) ||sf::Keyboard::isKeyPressed(sf::Keyboard::Space) || sf::Keyboard::isKeyPressed(pPreferences->m_key_action)) { + if (sf::Keyboard::isKeyPressed (sf::Keyboard::Escape ) || + sf::Keyboard::isKeyPressed (sf::Keyboard::Return ) || + sf::Keyboard::isKeyPressed (sf::Keyboard::Space ) || + sf::Keyboard::isKeyPressed (sf::Keyboard::A ) || + sf::Keyboard::isKeyPressed (pPreferences->m_key_action)) { break; } --- TSC-git-92d74ff7f.old/tsc/src/objects/text_box.cpp +++ TSC-git-92d74ff7f/tsc/src/objects/text_box.cpp @@ -149,7 +149,11 @@ if (input_event.type == sf::Event::KeyPressed) { // exit keys - if (input_event.key.code == pPreferences->m_key_action || input_event.key.code == sf::Keyboard::Escape || input_event.key.code == sf::Keyboard::Return || input_event.key.code == sf::Keyboard::Space) { + if (input_event.key.code == pPreferences->m_key_action || + input_event.key.code == sf::Keyboard::Escape || + input_event.key.code == sf::Keyboard::Return || + input_event.key.code == sf::Keyboard::A || + input_event.key.code == sf::Keyboard::Space) { display = 0; break; } --- TSC-git-92d74ff7f.old/tsc/src/user/preferences.cpp +++ TSC-git-92d74ff7f/tsc/src/user/preferences.cpp @@ -65,10 +65,10 @@ const sf::Keyboard::Key cPreferences::m_key_down_default = sf::Keyboard::Down; const sf::Keyboard::Key cPreferences::m_key_left_default = sf::Keyboard::Left; const sf::Keyboard::Key cPreferences::m_key_right_default = sf::Keyboard::Right; -const sf::Keyboard::Key cPreferences::m_key_jump_default = sf::Keyboard::S; +const sf::Keyboard::Key cPreferences::m_key_jump_default = sf::Keyboard::LControl; const sf::Keyboard::Key cPreferences::m_key_shoot_default = sf::Keyboard::Space; const sf::Keyboard::Key cPreferences::m_key_item_default = sf::Keyboard::Return; -const sf::Keyboard::Key cPreferences::m_key_action_default = sf::Keyboard::A; +const sf::Keyboard::Key cPreferences::m_key_action_default = sf::Keyboard::LAlt; const sf::Keyboard::Key cPreferences::m_key_screenshot_default = sf::Keyboard::P; const sf::Keyboard::Key cPreferences::m_key_editor_fast_copy_up_default = sf::Keyboard::Numpad8; const sf::Keyboard::Key cPreferences::m_key_editor_fast_copy_down_default = sf::Keyboard::Numpad2;