Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » DoubleClick with key pressing on viewer
DoubleClick with key pressing on viewer [message #911243] Tue, 11 September 2012 08:26 Go to next message
John M. is currently offline John M.Friend
Messages: 198
Registered: July 2010
Senior Member
Hello,

I am trying to implement a doubleclick listener which uses key pressing, too.
For example I want to open another editor I click double on the item while pressing the ctrl key.

Adding the DoubleClickListener is very easy with the method addDoubleClickListener from the viewer class.

But how to combine both?
My idea was to get the pressed key while the event occured, but I don't know how to get that information.

Thanks for any advices.
Re: DoubleClick with key pressing on viewer [message #911551 is a reply to message #911243] Tue, 11 September 2012 20:56 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
The double click event originating in SWT does contain info about the
pressed modifier keys in its stateMask, so if you're able to get at the
viewer's underlying SWT Control then you can add an SWT.MouseDoubleClick
listener to the SWT Control instead of adding it to the viewer.

If you're not able to do this for some reason then you can ask about
this on the eclipse.platform.jface newgroup/forum.

Grant


On 9/11/2012 4:26 AM, Missing name Mising name wrote:
> Hello,
>
> I am trying to implement a doubleclick listener which uses key pressing,
> too.
> For example I want to open another editor I click double on the item
> while pressing the ctrl key.
>
> Adding the DoubleClickListener is very easy with the method
> addDoubleClickListener from the viewer class.
>
> But how to combine both?
> My idea was to get the pressed key while the event occured, but I don't
> know how to get that information.
>
> Thanks for any advices.
Re: DoubleClick with key pressing on viewer [message #911853 is a reply to message #911551] Wed, 12 September 2012 13:02 Go to previous message
John M. is currently offline John M.Friend
Messages: 198
Registered: July 2010
Senior Member
Thanks for the advice, it worked for me.
Previous Topic:HTML5 support for SWTBrowser
Next Topic:Native Bottom Bar on Mac OS X Lion
Goto Forum:
  


Current Time: Fri Apr 19 21:26:28 GMT 2024

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

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

Back to the top