From 6b28f5c00187feeba3c0f2f985c79c6f1c77b3e3 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Sat, 27 Apr 2024 20:26:44 -0500 Subject: [PATCH] Allow using SPACE instead of ENTER in menus --- fallout_functions.py | 2 ++ fallout_selection.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fallout_functions.py b/fallout_functions.py index 8cf490d..35e1d06 100644 --- a/fallout_functions.py +++ b/fallout_functions.py @@ -17,6 +17,8 @@ HIDDEN_MASK = '*' NEWLINE = 10 +SPACE = 32 + DELETE = 330 BACKSPACE = 263 diff --git a/fallout_selection.py b/fallout_selection.py index e27f8f0..c2e114c 100644 --- a/fallout_selection.py +++ b/fallout_selection.py @@ -1,6 +1,6 @@ import curses from time import sleep -from fallout_functions import slowWrite, centeredWrite, NEWLINE, addSound +from fallout_functions import slowWrite, centeredWrite, NEWLINE, SPACE, addSound ###################### Functions ############################ @@ -15,7 +15,7 @@ def makeSelection(scr, SELECTIONS, MSGS): selection_start_y = scr.getyx()[0] width = scr.getmaxyx()[1] - while inchar != NEWLINE: + while inchar not in [NEWLINE, SPACE]: # move to start of selections and hightlight current selection scr.move(selection_start_y, 0) line = 0