From 9f8804390d9ad183a05dc5f4d8f99627e71a791e Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 13 Aug 2009 16:41:39 +0000 Subject: improved menu ESC handling --- src/client/buymenu.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/client/buymenu.cc') diff --git a/src/client/buymenu.cc b/src/client/buymenu.cc index 4a4107b..79b5444 100644 --- a/src/client/buymenu.cc +++ b/src/client/buymenu.cc @@ -140,5 +140,20 @@ void BuyMenu::draw() set_item(menu_itemtype, menu_itemname); } +bool BuyMenu::on_keypress(const int key, const unsigned int modifier) +{ + switch( key ) { + + case SDLK_ESCAPE: + this->hide(); + return true; + break; + default: + break; + } + + return Window::on_keypress(key, modifier); +} + } -- cgit v1.2.3