From dedd799710c70c596b71a05b0553e2f4f56d80be Mon Sep 17 00:00:00 2001 From: Ross Ferguson Date: Mon, 6 Jul 2020 05:06:49 +0100 Subject: [PATCH] ComboBox. Wire-up Home/End keys down to listview --- Terminal.Gui/Views/ComboBox.cs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Terminal.Gui/Views/ComboBox.cs b/Terminal.Gui/Views/ComboBox.cs index 7323fdf91..10190ff5e 100644 --- a/Terminal.Gui/Views/ComboBox.cs +++ b/Terminal.Gui/Views/ComboBox.cs @@ -276,13 +276,31 @@ namespace Terminal.Gui { return true; } - if(e.Key == Key.PageDown) { - listview.MovePageDown (); + if(e.Key == Key.PageDown) { + if (listview.SelectedItem != -1) { + listview.MovePageDown (); + } return true; } - if (e.Key == Key.PageUp) { - listview.MovePageUp (); + if (e.Key == Key.PageUp) { + if (listview.SelectedItem != -1) { + listview.MovePageUp (); + } + return true; + } + + if (e.Key == Key.Home) { + if (listview.SelectedItem != -1) { + listview.MoveHome (); + } + return true; + } + + if(e.Key == Key.End) { + if(listview.SelectedItem != -1) { + listview.MoveEnd (); + } return true; }