Open JouriM2 opened 4 weeks ago
Moving some details from the originating discussion...
e.Key.ToString()
returns "D1"
for the key (because of the enum) whereas "_1 One" registers "1" in the hotkey map.
For point 2:
This works as expected if you have a Menu
, which is the primary use of AccessText
. I'm not sure what the intended design is for out-of-menu access keys. You should be able to press the alt key, release it, and continue pressing access keys (with or without alt held down) to navigate. The non-menu access keys return to normal when the menu is closed.
It can be fixed in this area https://github.com/AvaloniaUI/Avalonia/blob/f140033e420ee39b16dcc0621d5580f94d5bcb2c/src/Avalonia.Base/Input/AccessKeyHandler.cs#L211-L230 by placing the following before the break;
. Not sure if there are any side-effects.
if (MainMenu is null)
{
_owner!.ShowAccessKeys = _showingAccessKeys = false;
}
Here is sample repo: https://github.com/JouriM2/AvDropDownBug It contains simple window with 3 edits and labels to access them.
implemented as:
Problems I have:
Number hotkeys not working. Pressing Alt+1 or Alt+2 do nothing. Alt+A works as expected and move focus to edit. If to press mouse on
Label
itself all three are works. How to use number hotkeys?After I press Alt on keyboard all hotkeys stay underlined until I press any mouse button inside window (any button, at any point inside window). At same time any keyboard actions do not remove highlighting. It seems like a bug and hotkeys need to be hidden after Alt key released.
Originally posted by @JouriM2 in https://github.com/AvaloniaUI/Avalonia/discussions/15939