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

Capturing an specific key pressed for ALL events

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



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Wed Mar 28, 2007 4:40 pm    Post subject: Capturing an specific key pressed for ALL events Reply with quote

Greetings!

I would like to know if a key, say, Keys.ESCAPE, is pressed no matter which event or location is live. I know I can set it on each event for each object, but is there a way to capture this for all events?

thanks,

jose
Back to top
View user's profile Send private message
Chris Miller



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

PostPosted: Thu Mar 29, 2007 10:50 am    Post subject: Re: Capturing an specific key pressed for ALL events Reply with quote

If all you want to do is have a default action for the Escape key on your Form, you might simply want to use Form.cancelButton, which gets its click event fired if the user presses Escape on a control that does not accept the Escape key.

If you do want to receive all key events, you can use a message filter via Application.addMessageFilter. Note that Form`s add message filters, and they're first-come first-served, so if you want to preempt Form's filter, add one ahead of time. See IMessageFilter and preFilterMessage.
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