about summary refs log tree commit diff
path: root/src/game/client/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/components')
-rw-r--r--src/game/client/components/menus.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp
index 2fe150e4..e4351260 100644
--- a/src/game/client/components/menus.cpp
+++ b/src/game/client/components/menus.cpp
@@ -930,23 +930,22 @@ bool MENUS::on_input(INPUT_EVENT e)
 {
 	last_input = time_get();
 	
-	if(is_active())
+	// special handle esc and enter for popup purposes
+	if(e.flags&INPFLAG_PRESS)
 	{
-		// special handle esc and enter for popup purposes
-		if(e.flags&INPFLAG_PRESS)
+		if(e.key == KEY_ESC)
 		{
-			if(e.key == KEY_ESC)
-			{
-				escape_pressed = true;
-				set_active(!is_active());
-				return true;
-			}
-			else if(e.key == KEY_ENTER)
-			{
-				enter_pressed = true;
-				return true;
-			}
+			escape_pressed = true;
+			set_active(!is_active());
+			return true;
 		}
+	}
+		
+	if(is_active())
+	{
+		// special for popups
+		if(e.flags&INPFLAG_PRESS || e.key == KEY_ENTER)
+			enter_pressed = true;
 		
 		if(num_inputevents < MAX_INPUTEVENTS)
 			inputevents[num_inputevents++] = e;