Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to handle the right mouse button
How to handle the right mouse button [message #448874] Fri, 14 January 2005 13:55 Go to next message
Florian Thienel is currently offline Florian ThienelFriend
Messages: 17
Registered: July 2009
Junior Member
Hello!

I want to handle clicks with the right mouse button with a MouseListener.
But what is the number for the right mouse button? Maybe 3 for a wheel
mouse and 2 for a normal mouse? How can I find out how many buttons are on
the mouse that is acutally installed?

Best Regards,

Florian Thienel
Re: How to handle the right mouse button [message #448925 is a reply to message #448874] Fri, 14 January 2005 18:21 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
Why do you want to handle the right mouse button? If it is to show a
context menu, you should use SWT.MenuDetect instead because the behaviour
differs from platform to platform (mouse up versus mouse down) plus there
are keyboard shortcuts to launch the context menu which you should support
for accessibility.


"Florian Thienel" <flori@docufy.de> wrote in message
news:cs8j0j$t3u$1@www.eclipse.org...
> Hello!
>
> I want to handle clicks with the right mouse button with a MouseListener.
> But what is the number for the right mouse button? Maybe 3 for a wheel
> mouse and 2 for a normal mouse? How can I find out how many buttons are on
> the mouse that is acutally installed?
>
> Best Regards,
>
> Florian Thienel
>
Re: How to handle the right mouse button [message #449090 is a reply to message #448925] Tue, 18 January 2005 09:32 Go to previous message
Florian Thienel is currently offline Florian ThienelFriend
Messages: 17
Registered: July 2009
Junior Member
It's a custom dialog to select special characters and insert them into a
text:
- double-left-click -> insert character into text and close dialog
- single-right-click -> insert character into text and keep dialog open


Veronika Irvine wrote:

> Why do you want to handle the right mouse button? If it is to show a
> context menu, you should use SWT.MenuDetect instead because the behaviour
> differs from platform to platform (mouse up versus mouse down) plus there
> are keyboard shortcuts to launch the context menu which you should support
> for accessibility.


> "Florian Thienel" <flori@docufy.de> wrote in message
> news:cs8j0j$t3u$1@www.eclipse.org...
>> Hello!
>>
>> I want to handle clicks with the right mouse button with a MouseListener.
>> But what is the number for the right mouse button? Maybe 3 for a wheel
>> mouse and 2 for a normal mouse? How can I find out how many buttons are on
>> the mouse that is acutally installed?
>>
>> Best Regards,
>>
>> Florian Thienel
>>
Previous Topic:View refresh problem
Next Topic:Java3D under SWT
Goto Forum:
  


Current Time: Thu Apr 25 10:33:59 GMT 2024

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

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

Back to the top