Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to consume KeyEvent in E4(barcodescanner Keyevent)
How to consume KeyEvent in E4 [message #1742269] Thu, 01 September 2016 10:01 Go to next message
Matthias Fiebiger is currently offline Matthias FiebigerFriend
Messages: 2
Registered: September 2016
Junior Member
Hello their,

I'm looking for a possibility to consume KeyEvents in E4.
In standard Java I would call java.awt.event.KeyEvent.consume().
No further Listener would receive this Event.

What to do in E4 to achieve this? I have not found a equivalent methode in
org.eclipse.swt.events.KeyEvent .

Or: is there a way to differentiate the source device of the KeyEvent?

Why i want to do this?:
I want to use a barcodescanner. The scanner is handled like a common Keyboarddevice. I have extended the org.eclipse.swt.widgets.Listener Interface to detect barcodes - it works. But the actually focused component will also receive the KeyEvents of the Scanner.

Thanks for your help.
Re: How to consume KeyEvent in E4 [message #1742295 is a reply to message #1742269] Thu, 01 September 2016 13:14 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 839
Registered: July 2009
Senior Member
Maybe, you want this:

org.eclipse.swt.events.KeyEvent.doit


Just set it to false which will break further processing by remaining listeners.
Re: How to consume KeyEvent in E4 [message #1742500 is a reply to message #1742295] Fri, 02 September 2016 12:43 Go to previous message
Matthias Fiebiger is currently offline Matthias FiebigerFriend
Messages: 2
Registered: September 2016
Junior Member
Thanks for your response.
I tried this some days ago. On Your Advice I tried it again. Sometimes it seems to work (Event Consumed), but in most cases not (Event processed by other Listeners).
In what order the Listeners in E4 are processed? Is there a place to register Listeners to be handled first?
My BarcodeListener is registered in the end of the @PostConstruct Methode of a Part. It listens to the display.
Previous Topic:news.eclipse.org is shutting down.
Next Topic:Difference between SetToBeRendered and SetVisible
Goto Forum:
  


Current Time: Tue Nov 21 04:45:59 GMT 2017

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

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