aboutsummaryrefslogtreecommitdiffstats
path: root/clients/urwid/main.py
diff options
context:
space:
mode:
authorBlake DeMarcy <ofunknowndescent@gmail.com>2017-04-13 08:50:05 -0500
committerBlake DeMarcy <ofunknowndescent@gmail.com>2017-04-13 08:50:05 -0500
commitdce87a8312f47587e727fd0313c4e7cdf2277911 (patch)
tree848702959e08ec719f12f1549efd139077520af2 /clients/urwid/main.py
parentf4cfcc56143cbe4bccd54b63fe473fcaf5804379 (diff)
downloadbbj-dce87a8312f47587e727fd0313c4e7cdf2277911.tar.gz
add keybind to wipe the screen
Diffstat (limited to 'clients/urwid/main.py')
-rw-r--r--clients/urwid/main.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/clients/urwid/main.py b/clients/urwid/main.py
index 5fc4072..4868111 100644
--- a/clients/urwid/main.py
+++ b/clients/urwid/main.py
@@ -1265,21 +1265,30 @@ class OptionsMenu(urwid.LineBox):
# try to let the base class handle the key, if not, we'll take over
elif not super(OptionsMenu, self).keypress(size, key):
return
+
elif key in ["shift down", "J", "N"]:
for x in range(5):
self.keypress(size, "down")
+
elif key in ["shift up", "K", "P"]:
for x in range(5):
self.keypress(size, "up")
+
elif key.lower() in ["left", "h", "q"]:
app.loop.widget = app.loop.widget[0]
+
elif key.lower() in ["right", "l"]:
return self.keypress(size, "enter")
+
elif key in ["ctrl n", "j", "n"]:
return self.keypress(size, "down")
+
elif key in ["ctrl p", "k", "p"]:
return self.keypress(size, "up")
+ elif key == "ctrl l":
+ wipe_screen()
+
class ActionBox(urwid.ListBox):
"""
@@ -1333,6 +1342,9 @@ class ActionBox(urwid.ListBox):
elif key.lower() == "q":
app.back(True)
+ elif key == "ctrl l":
+ wipe_screen()
+
def frilly_exit():
"""
@@ -1548,6 +1560,17 @@ def ignore(*_, **__):
pass
+def wipe_screen(*_):
+ """
+ A crude hack to repaint the whole screen. I didnt immediately
+ see anything to acheive this in the MainLoop methods so this
+ will do, I suppose.
+ """
+ app.loop.stop()
+ run("clear", shell=True)
+ app.loop.start()
+
+
def main():
global app
app = App()
Un proyecto texto-plano.xyz