--- smc.old/smc/src/gui/menu.cpp +++ smc/smc/src/gui/menu.cpp @@ -363,6 +363,32 @@ m_handler->Set_Active( m_handler->m_active - 1 ); } } + // End and PgDn keys + else if ((key == SDLK_END) || (key == SDLK_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 ((key == SDLK_HOME) || (key == SDLK_PAGEUP)) + { + m_handler->Set_Active (0); + } // Activate Button else if( key == SDLK_RETURN || key == SDLK_KP_ENTER ) {