View previous topic :: View next topic |
Author |
Message |
maxter
Joined: 17 May 2006 Posts: 34
|
Posted: Mon Oct 01, 2007 6:22 am Post subject: Form doesn't fire key events |
|
|
If no control on a form can receive input focus, key events should be fired by the main form. At least this is the way winforms work.
Code: |
class TestForm : Form
{
this()
{
auto l = new Label;
l.text = "Test";
controls.add(l);
}
// Should be called when a key is pressed while the form is receiving
// keyboard input
override void onKeyPress(KeyEventArgs ea)
{
msgBox("Test");
super.onKeyPress(ea);
}
}
|
|
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Tue Oct 02, 2007 12:54 am Post subject: Re: Form doesn't fire key events |
|
|
You're right; the current snapshot has a fix, thanks. |
|
Back to top |
|
|
|