-
Notifications
You must be signed in to change notification settings - Fork 694
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
Escape Key not invoking OnKeyDown on Window or Toplevel #3496
Comments
@tig , Note that I updated the issue and added that I also tested this in version 2 and the issue remains. Maybe the tagging should be updated. |
Thanks. This is likely due to the fact that CursesDriver think's it cute to support I've never been a fan of that as it relies on arbitrary timing and is actually not needed. We will fix this. |
😫
🥳 |
In the version 2 it's working as expected and so nothing need to be fixed. explorer_0n4i0k2S9M.mp4To test copy and paste this code on a scenario. public override void Main ()
{
Application.Init ();
try
{
Application.Run<MainWindow> ().Dispose ();
}
finally
{
Application.Shutdown ();
}
}
class MainWindow : Toplevel
{
Label labelDown;
public MainWindow ()
{
labelDown = new Label ();
labelDown.Text = "No key pressed yet!";
Add (labelDown);
}
public override bool OnKeyDown (Key keyEvent)
{
labelDown.Text = $"Keydown {keyEvent}";
if (keyEvent == Key.Esc && MessageBox.Query ("Quit", "Do you really want to exit?", "Ok", "Cancel") == 0)
{
Application.RequestStop();
}
return true;
}
} |
@BDisp , testing.... |
So. I tested against the latest versions in Nuget and every version from
Anyhow, version |
I closed this for me but, maybe, you want to keep it open for v1 Maintenance. I'll do as you see fit. And I'll be happy to test it then. |
Open again, please. After the PR is merged it will be automatically closed. Thanks. |
Fixes #3496. Escape Key not invoking OnKeyDown on Unix.
Tested in version |
I'm working on getting v1.17.0 pushed to nuget right now... |
Describe the bug
Escape
key is not invokingOnKeyDown
.To Reproduce
Expected behavior
When
Escape
key is pressed,OnKeyDown
should be called withKey
asKey.Esc
.Desktop:
The text was updated successfully, but these errors were encountered: