From 439ce3ed2d5cc29941496cc7cab0dbf1d18697a2 Mon Sep 17 00:00:00 2001 From: AndrewOlsen Date: Sat, 12 Aug 2017 14:00:01 -0400 Subject: [PATCH] added vim keybinds --- README.md | 8 ++++---- curseradio/curseradio.py | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 47e3fad..508991f 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Audio playback uses [`mpv`](http://mpv.io/). Curseradio requires `python3` and t Key(s) | Command -------|-------- -, | navigate -PgUp, PgDn | navigate quickly -Home, End | to top/bottom +k, j | navigate +PgUpK, PgDnJ | navigate quickly +Homeg, EndG | to top/bottom Enter | open/close folders, play stream -k | stop playing stream +s | stop playing stream q | quit f | toggle favourite diff --git a/curseradio/curseradio.py b/curseradio/curseradio.py index 66ea575..10249fb 100644 --- a/curseradio/curseradio.py +++ b/curseradio/curseradio.py @@ -329,19 +329,19 @@ def interact(self): """ while True: ch = self.screen.getch() - if ch == curses.KEY_UP: + if ch == curses.KEY_UP or ch == ord('k'): self.move(rel=-1) elif ch == curses.KEY_RESIZE: self.maxy, self.maxx = self.screen.getmaxyx() - elif ch == curses.KEY_DOWN: + elif ch == curses.KEY_DOWN or ch == ord('j'): self.move(rel=1) - elif ch == curses.KEY_HOME: + elif ch == curses.KEY_HOME or ch == ord('g'): self.move(to="start") - elif ch == curses.KEY_END: + elif ch == curses.KEY_END or ch == ord('G'): self.move(to="end") - elif ch == curses.KEY_PPAGE: # page up + elif ch == curses.KEY_PPAGE or ch == ord('K'): # page up self.move(rel=-self.maxy) - elif ch == curses.KEY_NPAGE: # page down + elif ch == curses.KEY_NPAGE or ch == ord('J'): # page down self.move(rel=self.maxy) elif ch == curses.KEY_ENTER or ch == ord('\n'): for msg in self.selected.activate(): @@ -364,7 +364,7 @@ def interact(self): self.child.wait() self.save_favourites() return - elif ch == ord('k'): + elif ch == ord('s'): if self.child is not None: self.child.terminate() self.child.wait()