ui/curses: wait for keys instead of polling

The main loop slept 100 ms whenever no key was pending, so keys took
up to a tick to register and every screen woke ten times a second.
Each view now declares how often it needs idle(): the game view keeps
its 100 ms tick, while menus wait for a key. getch() blocks for that
long, so keys register at once, and over 15 s in the roster menu the
process goes from about 300 wake-ups to 6.
This commit is contained in:
Dash committed 2026-10-17 19:57:28 +02:00
1 parent c9bce751ac
commit 9ceda9b873
3 files changed
+14 -4

No files matched your search

@@ -42,6 +42,8 @@ class PageScrollable(Protocol):
class GameView(BaseView):
idle_interval = 100
def __init__(
self,
screen: curses.window,