Johnny's right. A common event and a button you don't normally use will be just the key for this. Perhaps you can even have it give a choice first whether the player really wants to end the game. It's simple and best.
But if you want something more specific, like bringing up that little menu asking if you want to go to the title, shutdown, or cancel, you can just throw this in under materials. Just change Input::X to the button you want to use (remember that the A key is X, S key is Y, D key is Z, and so forth). The only downside is that if you have this in, you can't use the "Game End" from the main menu if you decide to not use the replace menu option after all. But then, you can easily erase this if you do do so.
class Scene_Map < Scene_Base
def update
super
$game_map.interpreter.update # Update interpreter
$game_map.update # Update map
$game_player.update # Update player
$game_system.update # Update timer
@spriteset.update # Update sprite set
@message_window.update # Update message window
unless $game_message.visible # Unless displaying a message
update_transfer_player
update_encounter
update_call_menu
update_call_debug
update_call_end
update_scene_change
end
end
def update_call_end
if Input.trigger?(Input::X)
return if $game_map.interpreter.running? # Event being executed?
$game_temp.menu_beep = true # Set SE play flag
$game_temp.next_scene = nil
$scene = Scene_End.new
end
end
end
class Scene_End < Scene_Base
def return_scene
$scene = Scene_Map.new
end
end