Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Catch KeyEvents
Catch KeyEvents [message #445238] Fri, 29 October 2004 12:32 Go to next message
Lars is currently offline LarsFriend
Messages: 32
Registered: July 2009
Member
Hi all

I have a problem that a lot of other people has as well, and I can not
seem to find a valid solution.

I want the application to have a 'global' keylistener, but when I use
the addListener in Display it does not work. The problem is that all
keyevents are forwarded (I guess) to the control in focus.

I am using Eclipse 2.1.1 and maybe the problem is solved in later
versions, but I am currently unable to update the version.

I have tried as well to create an action with an accelerator key, but it
is unreachable if focus is in a dialog.

Of course I can add a listener to every single control, that forwards
the event to a global listener, but I have like a thousand controls (and
no central controlfactory, which we of course should have created from
the start).

This is pretty annoying ... Can any of you give me some pointers?

*/Lars
Re: Catch KeyEvents [message #445256 is a reply to message #445238] Fri, 29 October 2004 18:06 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
It sounds like Display.addFilter() is what you want. This, and this ability
to cancel keys using the doit flag, is available only in 3.0. Sorry. The
good news is that things got faster in 3.0, specifically tables and trees on
all platforms.

"Lars" <lars@eclub2.procard.dk> wrote in message
news:cltd9k$b0o$1@eclipse.org...
>
> Hi all
>
> I have a problem that a lot of other people has as well, and I can not
> seem to find a valid solution.
>
> I want the application to have a 'global' keylistener, but when I use
> the addListener in Display it does not work. The problem is that all
> keyevents are forwarded (I guess) to the control in focus.
>
> I am using Eclipse 2.1.1 and maybe the problem is solved in later
> versions, but I am currently unable to update the version.
>
> I have tried as well to create an action with an accelerator key, but it
> is unreachable if focus is in a dialog.
>
> Of course I can add a listener to every single control, that forwards
> the event to a global listener, but I have like a thousand controls (and
> no central controlfactory, which we of course should have created from
> the start).
>
> This is pretty annoying ... Can any of you give me some pointers?
>
> */Lars
Previous Topic:Combo box doesn't take objects?
Next Topic:MDI forms with SWT
Goto Forum:
  


Current Time: Fri Oct 30 02:17:43 GMT 2020

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

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

Back to the top