mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-28 16:58:01 +01:00
@@ -346,6 +346,12 @@ namespace Terminal.Gui {
|
||||
OnOpenSelectedItem ();
|
||||
break;
|
||||
|
||||
case Key.End:
|
||||
return MoveEnd ();
|
||||
|
||||
case Key.Home:
|
||||
return MoveHome ();
|
||||
|
||||
}
|
||||
return base.ProcessKey (kb);
|
||||
}
|
||||
@@ -459,6 +465,38 @@ namespace Terminal.Gui {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves the selected item index to the last row.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual bool MoveEnd ()
|
||||
{
|
||||
if (selected != source.Count - 1) {
|
||||
selected = source.Count - 1;
|
||||
top = selected;
|
||||
OnSelectedChanged ();
|
||||
SetNeedsDisplay ();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves the selected item index to the first row.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual bool MoveHome ()
|
||||
{
|
||||
if (selected != 0) {
|
||||
selected = 0;
|
||||
top = selected;
|
||||
OnSelectedChanged ();
|
||||
SetNeedsDisplay ();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int lastSelectedItem = -1;
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user