aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Winston2022-03-30 22:48:51 -0400
committerBen Winston2022-03-30 22:48:51 -0400
commiteab16b636940c6eab91dc4a3be6ebe948069b882 (patch)
tree47354146d4f6dd891bea01aec950f0d1882a62a5
parent4c344891e35e0d8dc778560398ff21c4e50304b7 (diff)
initial commit of help toggle key
-rwxr-xr-xroku-cli.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/roku-cli.py b/roku-cli.py
index 11d30e3..e41574d 100755
--- a/roku-cli.py
+++ b/roku-cli.py
@@ -115,6 +115,31 @@ def search_loop(stdscr, base_url):
request_url = base_url + 'keypress/Lit_' + letter
urllib.request.urlopen(request_url, b'')
+def help_toggle(stdscr):
+
+ help_lines = ["'h' -> Home",
+ "'b' -> Back",
+ "'p' -> Play/Pause",
+ "'r' -> Replay",
+ "'*' -> Options (star key)",
+ "arrow keys -> navigation",
+ "ENTER -> OK",
+ "'<' -> Rewind",
+ "'>' -> Fast-Forward",
+ "'/' -> Toggle typing mode (ENTER or ESC to leave)",
+ "'?' -> Show this help screen",
+ "'q' -> Quit",
+ "",
+ "Press any key to return to remote"]
+
+ stdscr.clear()
+ status(stdscr)
+ for i in range(1,len(help_lines)+1):
+ stdscr.addstr(i, 1, help_lines[i - 1])
+ stdscr.getch() # wait for keypress
+ stdscr.clear()
+ status(stdscr)
+
def remote_loop(stdscr, remote):
while 1:
# draw all the keys
@@ -129,6 +154,8 @@ def remote_loop(stdscr, remote):
press_key(stdscr, remote.keys[c], remote.base_url)
elif c == '/':
search_loop(stdscr, remote.base_url)
+ elif c == '?':
+ help_toggle(stdscr)
elif c == 'q':
break