Skip to main content



      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 06:01 Go to next message
Eclipse UserFriend
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 09:14 Go to previous messageGo to next message
Eclipse UserFriend
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 08:43 Go to previous message
Eclipse UserFriend
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:Migrate old popupMenu extension to E4
Next Topic:3x e4 Bridge, View, and getting the Shell
Goto Forum:
  


Current Time: Tue Jul 08 08:16:22 EDT 2025

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

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

Back to the top