You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On macOS cmd+option+ input events are not working for the first char press. only for a second press, if you are not lifted up cmd+option. Other native apps handling shortcuts without any issues - so this is not an OS configuration fail.
To Reproduce
I've got a repro attached to the InputManager.PreProcess event so this is not a code/markup fail by me.
public partial class MainWindow : Window
{
public static MainWindow Self;
public MainWindow()
{
AvaloniaXamlLoader.Load(this);
Self = this;
AvaloniaLocator.Current.GetService<IInputManager>().PreProcess.Subscribe(new InputObserverRaw());
}
private class InputObserverRaw : IObserver<RawInputEventArgs>
{
public void OnCompleted() => Self.Title += "Completed";
public void OnError(Exception error) => Self.Title += error.ToString();
public void OnNext(RawInputEventArgs value)
{
if (value is RawKeyEventArgs args)
{
Self.Title = args.Type + ": " + args.Modifiers + " => " + args.Key;
}
}
}
private int _count;
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.Key == Key.K && e.KeyModifiers == (KeyModifiers.Alt | KeyModifiers.Meta))
{
_count++;
Title = "PRESSED! Meta+Alt+K " + _count;
e.Handled = true;
}
base.OnKeyDown(e);
}
}
Copy content above
Create new project from Avalonia template
Paste content to the MainWindow.axaml
Launch App
Hold cmd -> option -> Press K one time - no working, press again - working (window title showing the result)
release all keys and try again step 5.
Hold option -> cmd -> Press K - this order works!
Expected behavior
Hold cmd -> option -> input handling works on MacOS on first press
Desktop (please complete the following information):
OS: MacOS Big Sur
Version 11.3 Beta (Also our QA getting same issues on previous non-beta versions)
The text was updated successfully, but these errors were encountered:
I think this is wrong. AccessKeyHandler should not eat up all key alt downs. This is causing some issues in our app.
we cannot register alt down
hotkeys with alt do not work for the first press
So I will provide a fix that moves e.handles = true into the else...
Now it will eat alt presses only if main menu is open.
Describe the bug
On macOS cmd+option+ input events are not working for the first char press. only for a second press, if you are not lifted up cmd+option. Other native apps handling shortcuts without any issues - so this is not an OS configuration fail.
To Reproduce
I've got a repro attached to the InputManager.PreProcess event so this is not a code/markup fail by me.
Expected behavior
Hold cmd -> option -> input handling works on MacOS on first press
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: