mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Key API simplification
This commit is contained in:
@@ -73,7 +73,7 @@ public partial class View // Keyboard APIs
|
||||
/// <para>If the hot key is changed, the <see cref="HotKeyChanged"/> event is fired.</para>
|
||||
/// <para>Set to <see cref="Key.Empty"/> to disable the hot key.</para>
|
||||
/// </remarks>
|
||||
public virtual Key HotKey
|
||||
public Key HotKey
|
||||
{
|
||||
get => _hotKey;
|
||||
set
|
||||
@@ -684,8 +684,6 @@ public partial class View // Keyboard APIs
|
||||
/// </returns>
|
||||
protected bool? InvokeCommands (Key key, KeyBindingScope scope)
|
||||
{
|
||||
bool? toReturn = null;
|
||||
|
||||
if (!KeyBindings.TryGet (key, scope, out KeyBinding binding))
|
||||
{
|
||||
return null;
|
||||
|
||||
@@ -28,7 +28,6 @@ public partial class View // Layout APIs
|
||||
/// <param name="targetY">The target y location.</param>
|
||||
/// <param name="nx">The new x location that will ensure <paramref name="viewToMove"/> will be fully visible.</param>
|
||||
/// <param name="ny">The new y location that will ensure <paramref name="viewToMove"/> will be fully visible.</param>
|
||||
/// <param name="statusBar">The new top most statusBar</param>
|
||||
/// <returns>
|
||||
/// Either <see cref="Application.Top"/> (if <paramref name="viewToMove"/> does not have a Super View) or
|
||||
/// <paramref name="viewToMove"/>'s SuperView. This can be used to ensure LayoutSubviews is called on the correct View.
|
||||
|
||||
@@ -806,7 +806,7 @@ public class ListView : View, IDesignable
|
||||
protected override bool OnKeyDown (Key a)
|
||||
{
|
||||
// Enable user to find & select an item by typing text
|
||||
if (CollectionNavigatorBase.IsCompatibleKey (a) && (!AllowsMarking && a == Key.Space))
|
||||
if (CollectionNavigatorBase.IsCompatibleKey (a) || (!AllowsMarking && a == Key.Space))
|
||||
{
|
||||
int? newItem = KeystrokeNavigator?.GetNextMatchingItem (SelectedItem, (char)a);
|
||||
|
||||
|
||||
@@ -94,10 +94,7 @@ public class Keys : Scenario
|
||||
|
||||
edit.KeyDownNotHandled += (s, a) =>
|
||||
{
|
||||
if (edit.KeyBindings.TryGet (a, out KeyBinding binding))
|
||||
{
|
||||
keyDownNotHandledList.Add ($"{a}: {string.Join (",", binding.Commands)}");
|
||||
}
|
||||
keyDownNotHandledList.Add ($"{a}");
|
||||
};
|
||||
|
||||
// KeyDown
|
||||
|
||||
Reference in New Issue
Block a user