From 4c5e48c6a80419923e1d50b7b1b83b5a2a7a5911 Mon Sep 17 00:00:00 2001 From: NavigationHazard Date: Sun, 6 Feb 2022 18:29:33 +0100 Subject: [PATCH 1/4] Added Request https://github.com/aristocratos/btop/issues/234 --- src/btop_input.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/btop_input.cpp b/src/btop_input.cpp index 39fbd8a..f83dcf0 100644 --- a/src/btop_input.cpp +++ b/src/btop_input.cpp @@ -294,6 +294,10 @@ namespace Input { Config::set("proc_filtering", false); old_filter.clear(); } + else if (key == "down") { + Config::set("proc_filter", Proc::filter.text); + Config::set("proc_filtering", false); + } else if (key == "escape" or key == "mouse_click") { Config::set("proc_filter", old_filter); Config::set("proc_filtering", false); From 079052081818b29f4d700067e7a2b0e1834109fb Mon Sep 17 00:00:00 2001 From: NavigationHazard Date: Sun, 6 Feb 2022 18:32:35 +0100 Subject: [PATCH 2/4] Added Request - Arrow only after use of "f" in Process search --- src/btop_input.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/btop_input.cpp b/src/btop_input.cpp index f83dcf0..ca4e085 100644 --- a/src/btop_input.cpp +++ b/src/btop_input.cpp @@ -297,6 +297,7 @@ namespace Input { else if (key == "down") { Config::set("proc_filter", Proc::filter.text); Config::set("proc_filtering", false); + old_filter.clear(); } else if (key == "escape" or key == "mouse_click") { Config::set("proc_filter", old_filter); From eebcb08e49d7204dd91a8e459a3825e50ce89676 Mon Sep 17 00:00:00 2001 From: NavigationHazard Date: Tue, 8 Feb 2022 01:24:28 +0100 Subject: [PATCH 3/4] Best of Both Worlds. Both ways are workings now. Using enter and then moving with arrows or just using arrow down. --- src/btop_input.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/btop_input.cpp b/src/btop_input.cpp index ca4e085..273990d 100644 --- a/src/btop_input.cpp +++ b/src/btop_input.cpp @@ -292,13 +292,14 @@ namespace Input { if (key == "enter") { Config::set("proc_filter", Proc::filter.text); Config::set("proc_filtering", false); - old_filter.clear(); - } + old_filter.clear(); + } else if (key == "down") { - Config::set("proc_filter", Proc::filter.text); + Config::set("proc_filter", Proc::filter.text); Config::set("proc_filtering", false); old_filter.clear(); - } + process("down"); + } else if (key == "escape" or key == "mouse_click") { Config::set("proc_filter", old_filter); Config::set("proc_filtering", false); From 3887389e0ac813451592bab0f60dfacab2f1381e Mon Sep 17 00:00:00 2001 From: NavigationHazard Date: Tue, 8 Feb 2022 10:36:21 +0100 Subject: [PATCH 4/4] Added or and if statement --- src/btop_input.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/btop_input.cpp b/src/btop_input.cpp index 273990d..14cbbe3 100644 --- a/src/btop_input.cpp +++ b/src/btop_input.cpp @@ -289,17 +289,15 @@ namespace Input { bool no_update = true; bool redraw = true; if (filtering) { - if (key == "enter") { + if (key == "enter" or key == "down") { Config::set("proc_filter", Proc::filter.text); Config::set("proc_filtering", false); old_filter.clear(); + if(key == "down"){ + process("down"); + return; + } } - else if (key == "down") { - Config::set("proc_filter", Proc::filter.text); - Config::set("proc_filtering", false); - old_filter.clear(); - process("down"); - } else if (key == "escape" or key == "mouse_click") { Config::set("proc_filter", old_filter); Config::set("proc_filtering", false);