fix: Disable key debounce for text input entry and typing
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
5
main.py
5
main.py
@@ -45,13 +45,14 @@ def main_loop(stdscr):
|
||||
while True:
|
||||
c = stdscr.getch()
|
||||
if c != curses.ERR:
|
||||
current_screen = screens[state.current_screen]
|
||||
# Rate limit key presses unless in a text input field
|
||||
if not screens[state.current_screen].is_typing and time.time() < state.last_key_time + 1:
|
||||
if not current_screen.is_typing and not current_screen.is_entry_key(c) and time.time() < state.last_key_time + 1:
|
||||
pass # Key press ignored due to rate limit
|
||||
else:
|
||||
state.c = c
|
||||
state.last_key_time = time.time()
|
||||
screens[state.current_screen].handle_input(c)
|
||||
current_screen.handle_input(c)
|
||||
|
||||
if state.current_screen != state.prev_screen:
|
||||
logging.info('Switching to screen: %s', state.current_screen)
|
||||
|
||||
Reference in New Issue
Block a user