FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Form doesn't fire key events

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
maxter



Joined: 17 May 2006
Posts: 34

PostPosted: Mon Oct 01, 2007 6:22 am    Post subject: Form doesn't fire key events Reply with quote

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
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Tue Oct 02, 2007 12:54 am    Post subject: Re: Form doesn't fire key events Reply with quote

You're right; the current snapshot has a fix, thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group