Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Key event without focus
Key event without focus [message #440477] Mon, 02 August 2004 12:32 Go to next message
Eclipse UserFriend
Originally posted by: ryusasai.hotmail.com

Hi,

Could you tell me how to get F1 key event which is
nothing to do with any control's focuses?

For example, suppose there's a button saying "F1 exit",
and the focus is on some other button.
In such case, if user push F1, program should exits.
That's what I want to do.

Thank you.
Re: Key event without focus [message #440488 is a reply to message #440477] Mon, 02 August 2004 14:32 Go to previous messageGo to next message
Eclipse UserFriend
I believe you will need to create a KeyListner and add it to each control
that will gain focus at any point. You can add multiple key listeners, so
the only pain is having to add a line for each control object.
-Tej

Emma wrote:

> Hi,

> Could you tell me how to get F1 key event which is
> nothing to do with any control's focuses?

> For example, suppose there's a button saying "F1 exit",
> and the focus is on some other button.
> In such case, if user push F1, program should exits.
> That's what I want to do.

> Thank you.
Re: Key event without focus [message #440652 is a reply to message #440477] Thu, 05 August 2004 04:11 Go to previous message
Eclipse UserFriend
Hi Emma,

I think the Display.addFilter() method is what you're looking for.

Ryan



Emma wrote:

> Hi,

> Could you tell me how to get F1 key event which is
> nothing to do with any control's focuses?

> For example, suppose there's a button saying "F1 exit",
> and the focus is on some other button.
> In such case, if user push F1, program should exits.
> That's what I want to do.

> Thank you.
Previous Topic:Change folder icon in navigator
Next Topic:How to hide file extention in navigator view
Goto Forum:
  


Current Time: Tue Jul 15 14:19:11 EDT 2025

Powered by FUDForum. Page generated in 0.32227 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top