Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Is it possible to click mouse-middle key to pop the popupmenu?
Is it possible to click mouse-middle key to pop the popupmenu? [message #444575] Fri, 15 October 2004 10:18 Go to next message
lianhongwu is currently offline lianhongwuFriend
Messages: 17
Registered: July 2009
Junior Member
I do not want to click mouse right-key to pop the popmenu,I want to change
to the middle key in SWT,how can I do?
Re: Is it possible to click mouse-middle key to pop the popupmenu? [message #444588 is a reply to message #444575] Fri, 15 October 2004 14:31 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Ok, assuming you want this on mouse down, don't use SWT.MenuDetect or
Control.setMenu(). Instead, call Menu.setVisible() from inside an
SWT.MouseDown handler when button == 2. NOTE: Doing this will make your
users mad because your application will not be using the platform specific
mouse and key sequences to request a popup menu. For example, on Windows
it's right button up, on Linux right button down, on a single button Mac
Ctrl+Click etc.

"lianhw" <java_programmer@sohu.com> wrote in message
news:cko7qp$n64$1@eclipse.org...
> I do not want to click mouse right-key to pop the popmenu,I want to change
> to the middle key in SWT,how can I do?
>
>
Re: Is it possible to click mouse-middle key to pop the popupmenu? [message #444589 is a reply to message #444588] Fri, 15 October 2004 15:08 Go to previous messageGo to next message
Paul Singleton is currently offline Paul SingletonFriend
Messages: 37
Registered: July 2009
Member
Steve Northover wrote:
> Ok, assuming you want this on mouse down, don't use SWT.MenuDetect or
> Control.setMenu(). Instead, call Menu.setVisible() from inside an
> SWT.MouseDown handler when button == 2. NOTE: Doing this will make your
> users mad because your application will not be using the platform specific
> mouse and key sequences to request a popup menu. For example, on Windows
> it's right button up,

.... or Shift+F10 - please don't forget the keyboard
equivalents (presumably Linux and Mac have their own).

IIRC a MenuDetect event doesn't distinguish keyboard
from mouse origination, yet gives you mouse coords which
may be over the wrong widget :-/ for which I can find
no workaround.

I know, I know, I should go find the bug and vote for it,
but since you were quite rightly recommending MenuDetect,
I thought you might be susceptible to being reminded that
it ain't all there yet :-)

> on Linux right button down, on a single button Mac
> Ctrl+Click etc.

> "lianhw" <java_programmer@sohu.com> wrote in message
> news:cko7qp$n64$1@eclipse.org...
>
>>I do not want to click mouse right-key to pop the popmenu,I want to change
>>to the middle key in SWT,how can I do?

Paul Singleton
Re: Is it possible to click mouse-middle key to pop the popupmenu? [message #444628 is a reply to message #444588] Mon, 18 October 2004 08:32 Go to previous messageGo to next message
lianhongwu is currently offline lianhongwuFriend
Messages: 17
Registered: July 2009
Junior Member
Thanks a lot!I have successfully changed popupmenu to mouse middle-key,But
another question is:

On Unix,when click mouse middle-key ,the popupmenu popup, hold the
middle-key then release the middle-key,the selected menuitem on popupmenu
can not be selected,in order to select the menuItem,it muse click the
right-key or the left-key,

how can I make the menuIitem in popupmenu invoked by the middle-key
released event?!

"Steve Northover" <steve_northover@ca.ibm.com> д
Re: Is it possible to click mouse-middle key to pop the popupmenu? [message #445085 is a reply to message #444589] Mon, 25 October 2004 19:04 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Over the wrong widget? The x and y coordinates are in screen coordinates.
Is that the problem?

"Paul Singleton" <paul@jbgb.com> wrote in message
news:ckooru$r31$1@eclipse.org...
> Steve Northover wrote:
> > Ok, assuming you want this on mouse down, don't use SWT.MenuDetect or
> > Control.setMenu(). Instead, call Menu.setVisible() from inside an
> > SWT.MouseDown handler when button == 2. NOTE: Doing this will make your
> > users mad because your application will not be using the platform
specific
> > mouse and key sequences to request a popup menu. For example, on
Windows
> > it's right button up,
>
> ... or Shift+F10 - please don't forget the keyboard
> equivalents (presumably Linux and Mac have their own).
>
> IIRC a MenuDetect event doesn't distinguish keyboard
> from mouse origination, yet gives you mouse coords which
> may be over the wrong widget :-/ for which I can find
> no workaround.
>
> I know, I know, I should go find the bug and vote for it,
> but since you were quite rightly recommending MenuDetect,
> I thought you might be susceptible to being reminded that
> it ain't all there yet :-)
>
> > on Linux right button down, on a single button Mac
> > Ctrl+Click etc.
>
> > "lianhw" <java_programmer@sohu.com> wrote in message
> > news:cko7qp$n64$1@eclipse.org...
> >
> >>I do not want to click mouse right-key to pop the popmenu,I want to
change
> >>to the middle key in SWT,how can I do?
>
> Paul Singleton
Re: Is it possible to click mouse-middle key to pop the popupmenu? [message #445087 is a reply to message #444628] Mon, 25 October 2004 19:05 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
This seems like a bug in GTK (I assume you are using GTK). It's another
good reason not to fight the operating system. Please enter a problem
report with a stand alone snippet that shows the problem. Thanks.

"lianhw" <java_programmer@sohu.com> wrote in message
news:ckvumk$u4a$1@eclipse.org...
> Thanks a lot!I have successfully changed popupmenu to mouse middle-key,But
> another question is:
>
> On Unix,when click mouse middle-key ,the popupmenu popup, hold the
> middle-key then release the middle-key,the selected menuitem on popupmenu
> can not be selected,in order to select the menuItem,it muse click the
> right-key or the left-key,
>
> how can I make the menuIitem in popupmenu invoked by the middle-key
> released event?!
>
> "Steve Northover" <steve_northover@ca.ibm.com> д
Previous Topic:How to change the checkbox state in a CheckBoxTableViewer
Next Topic:[TextLayout] Icons within text
Goto Forum:
  


Current Time: Sun Oct 25 23:29:36 GMT 2020

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

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

Back to the top