[Git][NTPsec/ntpsec][master] Arrow keys now work in ntpmon.

Eric S. Raymond gitlab at mg.gitlab.com
Sun Dec 18 03:17:38 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
27e4f14d by Eric S. Raymond at 2016-12-17T22:17:30-05:00
Arrow keys now work in ntpmon.

- - - - -


2 changed files:

- docs/includes/ntpmon-body.txt
- ntpclients/ntpmon


Changes:

=====================================
docs/includes/ntpmon-body.txt
=====================================
--- a/docs/includes/ntpmon-body.txt
+++ b/docs/includes/ntpmon-body.txt
@@ -32,17 +32,17 @@ A few single-keystroke commands are available.
 
 a:: Change peer display to apeers mode, showing association IDs.
 
-d:: Toggle select mode (some peer will be reverse-video highlighted when on)
+d:: Toggle select mode (some peer will be reverse-video highlighted when on).
 
-j:: Select next peer (in select mode)
+j:: Select next peer (in select mode); arrow down also works.
 
-k:: Select previous peer (in select mode)
+k:: Select previous peer (in select mode); arrow up also works.
 
 n:: Toggle display of hostnames (vs. IP addresses).
 
 o:: Change peer display to opeers mode, showing destination address.
 
-p:: Change peer display to default mode, showing refid
+p:: Change peer display to default mode, showing refid.
 
 q:: Cleanly terminate the program.
 


=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -4,18 +4,22 @@
 Keystroke commands:
 
 'a': Change peer display to apeers mode, showing association IDs.
-'d': Toggle select mode (some peer will be reverse-video highlighted when on)
-'j': Select next peer (in select mode)
-'k': Select previous peer (in select mode)
+'d': Toggle select mode (some peer will be reverse-video highlighted when on).
+'j': Select next peer (in select mode); arrow down also works.
+'k': Select previous peer (in select mode); arrow up also works.
 'n': Toggle display of hostnames (vs. IP addresses).
 'o': Change peer display to opeers mode, showing destination address.
-'p': Change peer display to default mode, showing refid
+'p': Change peer display to default mode, showing refid.
 'q': Cleanly terminate the program.
 's': Show all hosts, not just reachable ones.
 'w': Toggle wide mode.
 'x': Cleanly terminate the program.
 ' ': Rotate through display modes. 
-'?': Display helpscreen
+'?': Display helpscreen.
+
+When no peer is selected, <space> rotates through a/n/o display modes
+for the whole peers list. When a peer is selected, <space> toggles
+detail-display mode.
 '''
 
 from __future__ import print_function, division
@@ -75,7 +79,7 @@ class OutputContext:
         curses.curs_set(0)
         curses.cbreak()
         curses.noecho()
-        stdscr.keypad(1)
+        stdscr.keypad(True)
     def __exit__(self, extype_unused, value_unused, traceback_unused):
         curses.endwin()
 
@@ -235,10 +239,10 @@ if __name__ == '__main__':
                                 peer_report.displaymode = 'opeers'
                             else:
                                 peer_report.displaymode = 'peers'
-                    elif key == 'j' or key == curses.KEY_DOWN:
+                    elif key == 'j' or key == "KEY_DOWN":
                         selected += 1
                         selected %= len(peers)
-                    elif key == 'k' or key == curses.KEY_UP:
+                    elif key == 'k' or key == "KEY_UP":
                         selected += len(peers) - 1
                         selected %= len(peers)
                     elif key == '?':



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/27e4f14dd8b6da18730cfa60787d929ac09c4184
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161218/233a240f/attachment.html>


More information about the vc mailing list