Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Throw away certain key events for Table?
Throw away certain key events for Table? [message #459102] Tue, 02 August 2005 02:04 Go to next message
Eclipse UserFriend
Originally posted by: functorx.yahoo.com

I am writing my first SWT app, and don't really know how to find the
answer to my question other than to ask you guys.

I have an SWT Table in my application. This table supports keyboard
navigation in the way that I would expect, which is good.

I've added a KeyListener to this table, which I use to enable certain
special keys to perform actions.

What I would like to do is to filter out certain keys from being sent to
the Table's default key handler. For instance, if I press '=', my program
performs the special action for '=' (implemented by my keylistener) but
then jumps to any entry whose text begins with '='. After handling that
keypress, I'd like to throw it out.

I'm used to overriding some handleKey() method and then only calling the
handleKey() for the superclass when I want to pass the event on. Is there
some sort of analogous hierarchy for event handling in SWT?

Thanks a lot,

Tom 7
Re: Throw away certain key events for Table? [message #459143 is a reply to message #459102] Tue, 02 August 2005 14:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: functorx.yahoo.com

Well, I figured out one way to do it. If I set the field e.doit to false
in the event, then it is ignored. There must be a better way, though,
because this is kinda nasty... ideas?

Tom
Re: Throw away certain key events for Table? [message #459165 is a reply to message #459143] Tue, 02 August 2005 19:33 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Nope. That's the right way to do it.

"Tom 7" <functorx@yahoo.com> wrote in message
news:7ae64934628c322b61b411c5c888e033$1@www.eclipse.org...
> Well, I figured out one way to do it. If I set the field e.doit to false
> in the event, then it is ignored. There must be a better way, though,
> because this is kinda nasty... ideas?
>
> Tom
>
Previous Topic:Shell doesn't restore when clicking in taskbar
Next Topic:extra column in TableViewer/Table in EditorPart
Goto Forum:
  


Current Time: Thu Sep 19 22:40:12 GMT 2024

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

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

Back to the top