]> git.armaanb.net Git - lightcards.git/commitdiff
Reconfigure keybindings and add arrow key support
authorArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 00:14:14 +0000 (19:14 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 00:14:14 +0000 (19:14 -0500)
lightcards/display.py

index c2b7eb0ade79a7c18a5093c619f298ec665ebf2d..b276680adc3331689928bf7f32835d981f58e982 100755 (executable)
@@ -67,15 +67,15 @@ def get_key(stdscr, stack, headers):
         try:
             if key == "q" or key == os.linesep:
                 exit(0)
-            if key == "j":
+            elif key in ["l", "KEY_LEFT"]:
                 idx.forward(stack)
                 idx.setSide(0)
                 disp_card(stdscr, stack, headers, idx)
-            if key == "k":
+            elif key in ["h", "KEY_RIGHT"]:
                 idx.back()
                 idx.setSide(0)
                 disp_card(stdscr, stack, headers,  idx)
-            if key == "l" or key == "h":
+            elif key in ["j", "k", "KEY_UP", "KEY_DOWN"]:
                 idx.flip()
                 disp_card(stdscr, stack, headers, idx)
         except Exception: