Browse Source

ComboBox. Wire-up Home/End keys down to listview

Ross Ferguson 5 years ago
parent
commit
dedd799710
1 changed files with 22 additions and 4 deletions
  1. 22 4
      Terminal.Gui/Views/ComboBox.cs

+ 22 - 4
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) {
+				if (listview.SelectedItem != -1) {
+					listview.MovePageUp ();
+				}
 				return true;
 			}
 
-			if (e.Key == Key.PageUp) { 
-				listview.MovePageUp ();
+			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;
 			}