View previous topic :: View next topic |
Author |
Message |
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Wed Mar 28, 2007 4:40 pm Post subject: Capturing an specific key pressed for ALL events |
|
|
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 |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Thu Mar 29, 2007 10:50 am Post subject: Re: Capturing an specific key pressed for ALL events |
|
|
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 |
|
|
|
|
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
|