]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
split: support more interactive keys 631/head
authoryvs <VSYakovetsky@gmail.com>
Fri, 8 May 2026 13:52:04 +0000 (17:52 +0400)
committerDarafei Praliaskouski <me@komzpa.net>
Fri, 8 May 2026 13:52:04 +0000 (17:52 +0400)
Port the split-mode key handling idea from the mtr085 fork and adapt it to upstream mtr actions.  This lets split mode use the same pause, resume, display, compact, MPLS, DNS, and scroll keys that the select loop already supports.

Ported-from: yvs2014/mtr085@097bda215b79cac11b54a8a7baead218c1868b6c

Ported-from: yvs2014/mtr085@c69b13656f921c00c85581cac23f5f2b438ca186

Original-author: yvs <VSYakovetsky@gmail.com>

ui/split.c

index 15fd3cfb5357389138a23a29a2fed39b0363abc9..34d29676f325206394a3a265ed02dea6e49c1c96 100644 (file)
@@ -200,6 +200,22 @@ int split_keyaction(
         return ActionQuit;
     if (tolower(c) == 'r')
         return ActionReset;
+    if (tolower(c) == 'p')
+        return ActionPause;
+    if (c == ' ')
+        return ActionResume;
+    if (tolower(c) == 'd')
+        return ActionDisplay;
+    if (tolower(c) == 'c')
+        return ActionCompact;
+    if (tolower(c) == 'e')
+        return ActionMPLS;
+    if (tolower(c) == 'n')
+        return ActionDNS;
+    if (c == '+')
+        return ActionScrollDown;
+    if (c == '-')
+        return ActionScrollUp;
 
     return 0;
 }