about summary refs log tree commit diff
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-09-12 13:40:24 +0200
committeroy <Tom_Adams@web.de>2010-09-12 13:40:24 +0200
commit5437513a0d0101fe45137f2ad6d7086a94766cfe (patch)
treef471c0fa4fc82211e9be47285ae3197c1c2a223f
parent64c9b5c4abf8b96aac2ad5078a845ea8167e0907 (diff)
downloadzcatch-5437513a0d0101fe45137f2ad6d7086a94766cfe.tar.gz
zcatch-5437513a0d0101fe45137f2ad6d7086a94766cfe.zip
use escape key to abort binding a control key in the menu
-rw-r--r--src/game/client/components/menus.cpp4
-rw-r--r--src/game/client/components/menus_settings.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp
index 05817d3a..2341ba5e 100644
--- a/src/game/client/components/menus.cpp
+++ b/src/game/client/components/menus.cpp
@@ -459,7 +459,9 @@ int CMenus::DoKeyReader(void *pID, const CUIRect *pRect, int Key)
 	{
 		if(m_Binder.m_GotKey)
 		{
-			NewKey = m_Binder.m_Key.m_Key;
+			// abort with escape key
+			if(m_Binder.m_Key.m_Key != KEY_ESCAPE)
+				NewKey = m_Binder.m_Key.m_Key;
 			m_Binder.m_GotKey = false;
 			UI()->SetActiveItem(0);
 			MouseReleased = false;
diff --git a/src/game/client/components/menus_settings.cpp b/src/game/client/components/menus_settings.cpp
index 3a97e3ec..c7ecbf2f 100644
--- a/src/game/client/components/menus_settings.cpp
+++ b/src/game/client/components/menus_settings.cpp
@@ -31,7 +31,7 @@ bool CMenusKeyBinder::OnInput(IInput::CEvent Event)
 {
 	if(m_TakeKey)
 	{
-		if(Event.m_Flags&IInput::FLAG_PRESS && Event.m_Key != KEY_ESCAPE)
+		if(Event.m_Flags&IInput::FLAG_PRESS)
 		{
 			m_Key = Event;
 			m_GotKey = true;