Accept 'j' and 'k' for 'down' and 'up' in CEO menus.
authorMichael Spang <mspang@uwaterloo.ca>
Mon, 30 Apr 2007 21:30:09 +0000 (17:30 -0400)
committerMichael Spang <mspang@uwaterloo.ca>
Mon, 30 Apr 2007 21:43:47 +0000 (17:43 -0400)
pylib/csc/apps/legacy/helpers.py

index 74a6bb8..a18a193 100644 (file)
@@ -381,11 +381,11 @@ def menu(wnd, offy, offx, width, options, _acquire_wnd=None):
         keypress = wnd.getch()
 
         # UP moves to the previous option
-        if keypress == curses.KEY_UP and selected > 0:
+        if (keypress == curses.KEY_UP or keypress == ord('k')) and selected > 0:
             selected = (selected - 1)
 
         # DOWN moves to the next option
-        elif keypress == curses.KEY_DOWN and selected < len(options) - 1:
+        elif (keypress == curses.KEY_DOWN or keypress == ord('j')) and selected < len(options) - 1:
             selected = (selected + 1)
 
         # RETURN runs the callback for the selected option