Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control.KeyDown event not registering properly on macOS #12312

Closed
IsaacMarovitz opened this issue Jul 24, 2023 · 3 comments
Closed

Control.KeyDown event not registering properly on macOS #12312

IsaacMarovitz opened this issue Jul 24, 2023 · 3 comments
Labels

Comments

@IsaacMarovitz
Copy link

Describe the bug
Control.KeyDown fails to trigger when non-modifier keys are initially pressed on macOS. Modifier keys like Shift or Cmd are registered immediately, but non-modifier keys must be held in order to trigger the event.

To Reproduce
Subscribe to the KeyDown event on macOS, and log the event to Console. Try pressing a non-modifier key; it will not be registered. Try holding a non-modifier key; it will be registered.

Expected behavior
Non-modifier keys get immediately registered.

Desktop

  • OS: macOS Ventura & Sonoma
  • Version: 11
@IsaacMarovitz
Copy link
Author

Worth noting that this is a pretty severe issue for Ryujinx's use case, as we rely on this event for all key inputs.

@IsaacMarovitz
Copy link
Author

IsaacMarovitz commented Jul 24, 2023

Also worth noting that the result of the TextInput event is correct.

@riperiperi
Copy link

riperiperi commented Jul 30, 2023

The delayed event for the key down seems to coincide with the appearance of this dialog (for s in the example):

image

For Ryujinx, this appears at the bottom left corner of the screen. We don't need to select a variant of the key, we just want the raw one.

EDIT: Seems related to calling _control.AddHandler(InputElement.TextInputEvent, Control_LastChanceTextInput, RoutingStrategies.Bubble);. This was called before to attempt to stop the bell sound happening when holding keys on macos, but now it seems to stop the initial event getting to keydown. It might not be needed anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants