Commit 717957e3 authored by Mark Tearle's avatar Mark Tearle

Add keystroke handler (start therof)

parent 5786dab3
...@@ -20,6 +20,12 @@ class VirtualSnack(npyscreen.Form): ...@@ -20,6 +20,12 @@ class VirtualSnack(npyscreen.Form):
self.date_widget = self.add(npyscreen.FixedText, value=datetime.now(), editable=False) self.date_widget = self.add(npyscreen.FixedText, value=datetime.now(), editable=False)
self.date_widget.value = "Hello" self.date_widget.value = "Hello"
self.add_handlers({"^T": self.exit_application})
def exit_application(self,name):
self.parentApp.setNextForm(None)
self.editing = False
class VirtualSnackApp(npyscreen.NPSAppManaged): class VirtualSnackApp(npyscreen.NPSAppManaged):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment