Key API simplification

This commit is contained in:
Tig
2024-10-14 16:48:28 -06:00
parent 3f3ceae9c7
commit 89d8b74c3d
4 changed files with 3 additions and 9 deletions

View File

@@ -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;

View File

@@ -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.

View File

@@ -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);

View File

@@ -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