[kepler-dev] right-click on Mac

Christopher Hylands Brooks cxh at eecs.berkeley.edu
Tue Apr 27 07:43:22 PDT 2004


We could have multiple configurations that determine what mouse
actions do what.  In the simplest form, the configuration could
be different for Mac users and Windows users.

The problem we have is that we have access to only one Mac (it belongs
to my wife), and no one has come up with a good suggestion as to what
the precise key binding/mouse action should be.

I've taken the liberty of reproducing a thread from August, 2003,
where we discussed various possibilities.

In August, 2003, Stove wrote:
> http://webinstituteforteachers.org/2001/modules/pcmac/w2m-keys.html

Unfortunately, this link is dead.

> This seems to suggest that using the openApple/command key is the right 
> thing to do...
> 
> Steve
> 
> At 05:34 PM 8/19/2003 -0700, Stephen Andrew Neuendorffer wrote:
> >If you do this, then there is no way to connect from an external port to a 
> >relation...
> >I suppose if you get me the key code, then we could change control-click 
> >to openApple click, or some such...
> >I don't think that has a regular binding, if I remember?
> >
> >It's a shame that mac users only have one finger....
> >
> >Steve
> >
> >At 05:26 PM 8/19/2003 -0700, Christopher Hylands Brooks wrote:
> >>While looking at the mac . . .
> >>
> >>Usually, in Ptolemy II, Control-Click creates a Relation
> >>However, on the Mac, Control-Click should bring up the context
> >>menu.
> >>
> >>We should go ahead and disable Control-Click on the mac
> >>One way to tell we are on a mac is that the os.name property
> >>is equal to
> >>Mac OS X
> >>
> >>
> >>Under Mac OS X, Java 1.4.1_01, the properties have the following values:
> >>
> >>nlpx.heapsize = NULL,128m
> >>jnlpx.splashport = -1
> >>java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition
> >>sun.boot.library.path =
> >>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Libraries
> >>apple.awt.textantialiasing = on
> >>java.vm.version = 1.4.1_01-14
> >>awt.nativeDoubleBuffering = true
> >>gopherProxySet = false
> >>java.vm.vendor = "Apple Computer, Inc."
> >>java.vendor.url = http://apple.com/
> >>path.separator = :
> >>java.vm.name = Java HotSpot(TM) Client VM
> >>file.encoding.pkg = sun.io
> >>jnlpx.home = /Applications/Utilities/Java/Java Web
> >>Start.app/Contents/MacOS
> >>user.country = US
> >>sun.os.patch.level = unknown
> >>java.vm.specification.name = Java Virtual Machine Specification
> >>user.dir = /Users/tz
> >>java.runtime.version = 1.4.1_01-39
> >>java.awt.graphicsenv = apple.awt.CGraphicsEnvironment
> >>java.endorsed.dirs =
> >>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Home/lib/endorsed
> >>os.arch = ppc
> >>java.io.tmpdir = /tmp
> >>line.separator =
> >>
> >>java.vm.specification.vendor = Sun Microsystems Inc.
> >>jnlpx.remove = true
> >>os.name = Mac OS X
> >>apple.laf.useScreenMenuBar = true
> >>sun.java2d.fontpath =
> >>sun.java2d.noddraw = true
> >>java.library.path = /Applications/Utilities/Java/Java Web
> >>Start.app/Contents/MacOS/../../Contents/Resources/Java/
> >>java.specification.name = Java Platform API Specification
> >>java.class.version = 48.0
> >>java.util.prefs.PreferencesFactory =
> >>java.util.prefs.MacOSXPreferencesFactory
> >>os.version = 10.2.6
> >>ptolemy.ptII.dir = Users/tz/Library/Caches/Java Web
> >>Start/cache/http/Dptolemy.eecs.berkeley.edu/P80/DMptolemyII/DMptII3.0/DMjnlp-3.0.1/DMsigned
> >>user.home = /Users/tz
> >>user.timezone = America/Los_Angeles
> >>java.security.policy = file:/Applications/Utilities/Java/Java Web
> >>Start.app/Contents/MacOS/javaws.policy
> >>java.awt.printerjob = apple.awt.CPrinterJob
> >>trustProxy = true
> >>java.specification.version = 1.4
> >>file.encoding = MacRoman
> >>user.name = tz
> >>com.apple.javaws.vmversions = 1.4.1 1.3.1
> >>java.class.path = /Applications/Utilities/Java/Java Web
> >>Start.app/Contents/MacOS/javaws.jar
> >>jnlpx.vmargs = " -Dsun.java2d.noddraw=true"
> >>java.vm.specification.version = 1.0
> >>sun.arch.data.model = 32
> >>java.home = /System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Home
> >>java.specification.vendor = Sun Microsystems Inc.
> >>user.language = en
> >>awt.toolkit = apple.awt.CToolkit
> >>java.vm.info = mixed mode
> >>java.version = 1.4.1_01
> >>java.ext.dirs = 
> >>/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Home/lib/ext
> >>sun.boot.class.path = 
> >>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/sunrsasign.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Classes/charsets.jar
> >>java.vendor = Apple Computer, Inc.
> >>file.separator = /
> >>java.vendor.url.bug = http://developer.apple.com/java/
> >>sun.cpu.endian = big
> >>sun.io.unicode.encoding = UnicodeBig
> >>mrj.version = 4.1
> >>jnlpx.jvm = 
> >>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Home/bin/java
> >>sun.cpu.isalist =
> >>javawebstart.version = javaws-1.2
> >>sun.awt.exception.handler = apple.awt.CToolkit$EventQueueExceptionHandler
> >>
> >>-Christopher
> >>--------
> >>
> >>
> >>     I don't think isPopupTrigger helps...
> >>     Our problem isn't identifying the popup trigger...
> >>     It's that it has too many meanings.
> >>
> >>     I suggest we disable control-click to create relations
> >>     on the mac.  mac users will have to create relations from
> >>     the toolbar...  awkward, but I can't think of anything else...
> >>
> >>     I don't think putting a "Create relations" option in the
> >>     context menu will be very useful...
> >>
> >>     I'm guessing that creating arcs won't be a problem because
> >>     that is "control-drag" not "control-click".  But I guess we
> >>     should try it on a mac.
> >>
> >>     Edward
> >>
> >>
> >>
> >>     At 08:53 AM 6/30/2003 -0700, Christopher Hylands wrote:
> >>  >Below are some random notes
> >>  >
> >>  >I poked around and searching google with
> >>  >   Java Mac right mouse click
> >>  >
> >>  >Brings up a link to the Apple  site that appears to be dead.
> >>  >The google cache suggests using isPopupTrigger:
> >>  >
> >>  >--start--
> >>  >Contextual Menus
> >>  >
> >>  >There is no problem supporting contextual menus in your Java
> >>  >applications on Mac OS Xthey are fully supported. There are
> >>  >slight differences in terminology though. Java calls them popup
> >>  >menus while Aqua calls them contextual menus. More important is
> >>  >how they are triggered on different platforms. On Mac OS X,
> >>  >they are triggered by a Control-click. (By default, the second
> >>  >button of a two-button mouse maps to Control-click in Mac OS
> >>  >X.) In Windows, the right mouse button is the standard trigger
> >>  >for contextual menus.
> >>  >
> >>  >These are two very different cases, which could result in
> >>  >fragmented and conditional code. One important aspect of both
> >>  >triggers is shared, the mouse click. To ensure that your
> >>  >program is interpreting the proper contextual menu trigger, it
> >>  >is again a good idea to ask the AWT to do the interpreting for
> >>  >you with java.awt.event.MouseEvent.isPopupTrigger.
> >>  >
> >>  >The method is defined in java.awt.event.MouseEvent because you
> >>  >need to activate the contextual menu through a
> >>  >java.awt.event.MouseListener on a given component when a mouse
> >>  >event on that component is detected. The important thing to
> >>  >determine is how and when to detect the proper event. In Mac OS
> >>  >X, the pop up trigger is set on MOUSE_PRESSED. In Windows it is
> >>  >set on MOUSE_RELEASED. For portability, both cases should be
> >>  >considered as shown in Listing 5-4.

> >>  >
> >>  >Listing 5-4 Using isPopupTrigger to detect contextual menu activation
> >>  >
> >>  >JLabel label = new JLabel("I have a pop up menu!");
> >>  >
> >>  >label.addMouseListener(new MouseAdapter(){
> >>  >     public void mousePressed(MouseEvent e) {
> >>  >        evaluatePopup(e);
> >>  >     }
> >>  >
> >>  >     public void mouseReleased(MouseEvent e) {
> >>  >        evaluatePopup(e);
> >>  >     }
> >>  >
> >>  >     private void evaluatePopup(MouseEvent e) {
> >>  >        if (e.isPopupTrigger()) {
> >>  >           // show the pop up menu...
> >>  >        }
> >>  >     }
> >>  >});
> >>  >--end--
> >>  >
> >>  >The same text can be found in
> >>  >http://developer.apple.com/documentation/Java/Conceptual/Java141Development/Native_Integration/chapter_8_section_2.html
> >>  >
> >>  >I'm not sure if the above will help or not.
> >>  >
> >>  >I think that using control-click is a bit of a anomoly.  What we have
> >>  >now is:
> >>  >
> >>  >
> >>  >Action                    Key-Mouse             Class
> >>  >------                    ---------             -----
> >>  >toggle selection          shift-click
> >>  >create relation           control-click         ActorEditorGraphController
> >>  >                                                 LinkController
> >>  >
> >>  >create arc                control-click         FSMGraphController
> >>  >                                                 TransitionController
> >>  >
> >>  >
> >>  >Perhaps we should disable control-click on the mac and provide
> >>  >the create relation choice in the context menu?
> >>  >
> >>  >
> >>  >
> >>  >I'm not sure if this helps, but in poking around on the Apple site, I
> >>  >ran into a page about their interface builder at
> >>  >
> >>  >http://developer.apple.com/documentation/DeveloperTools/Conceptual/InterfaceBuilder/InterfaceBuilder_Help/CocoaObj/chapter_6_section_2.html
> >>  >
> >>  >It looks like it is a block diagram editor, and they have the user
> >>  >make connections with:
> >>  >
> >>  >--start--
> >>  >To make an outlet connection:
> >>  >
> >>  >     * Control-drag from the object that will send messages to the
> >>  >object that will receive messages. In the Info window that appears,
> >>  >select an outlet and click Connect.
> >>  >
> >>  >       Generally, you connect an object in the icon mode of the
> >>  >Instances pane of the nib file window to an object on the interface.
> >>  >
> >>  >       You can also use the outline mode of the Instances
> >>  >pane of the nib file window to connect objects, including
> >>  >objects in your interface.
> >>  >
> >>  >Tip: You can graphically identify objects listed in the
> >>  >outline mode of the Instances pane. To select an object in
> >>  >your interface, double-click it. To see an arrow point at
> >>  >the object, Shift-Control-click it.
> >>  >--end--
> >>  >
> >>  >See also
> >>  >http://developer.apple.com/documentation/Cocoa/Conceptual/JavaTutorial/simpleapp/chapter_2_section_5.html
> >>  >
> >>  >
> >>  >
> >>  >Tansy has a Mac, so I can try things out later.
> >>  >
> >>  >I have a few notes about Mac OS X Java at
> >>  >http://www.gigascale.org/ptolemy/java/mac.htm
> >>  >
> >>  >-Christopher
> >>  >
> >>  >--------
> >>  >
> >>  >     We tried his suggestion, but shift click is also used
> >>  >    to toggle selection, so his suggestion didn't work.
> >>  >    Christopher inquired about other mac users and nobody
> >>  >    spoke up with a suggestion.  I'm happy to fix this is
> >>  >    somebody tells be how to fix it...  However, without a
> >>  >    better suggestion...
> >>  >
> >>  >     Steve
> >>  >
> >>  >--------
> >>  >
> >>  > > From: "Edward A Lee" <eal at eecs.berkeley.edu>
> >>  > > To: ptresearch at eecs.berkeley.edu
> >>  > > Subject: [Ptolemy] Fwd: RE: Ptolemy II under Mac OS X
> >>  > > Date: Mon, 30 Jun 2003 04:34:13 -0700
> >>  > >
> >>  > >
> >>  > > Did we ever get some resolution on this?
> >>  > >
> >>  > > Edward
> >>  > >
> >>  > > >From: "Fons, Richard" <RFons at amsuper.com>
> >>  > > >To: "'Edward A. Lee'" <eal at eecs.berkeley.edu>
> >>  > > >Subject: RE: Ptolemy II under Mac OS X
> >>  > > >Date: Mon, 6 Jan 2003 10:12:54 -0500
> >>  > > >X-Mailer: Internet Mail Service (5.5.2653.19)
> >>  > > >
> >>  > > >Professor Lee,
> >>  > > >
> >>  > > >Control-L appears to be an auto layout type of command
> >>  > > >on both the Mac and Windows versions of Ptolemy II, so I
> >>  > > >still don't have a way to "look inside" when running on
> >>  > > >the Mac.  My only suggestion at this point would be to
> >>  > > >ask you to consider changing "create new relation" to
> >>  > > >something like a shift-click instead of a control-click,
> >>  > > >since the Mac wants to assume that acontrol-click will
> >>  > > >bring up a contextual menu.  This is not a crisis for me
> >>  > > >as I use a Windows 2000 machine at work, but I have a
> >>  > > >Mac at home and it would be nice to run Ptolemy II there
> >>  > > >as well.
> >>  > > >
> >>  > > >Thanks,
> >>  > > >
> >>  > > >Dick Fons.
> >>  > > >
> >>  > > >
> >>  > > >
> >>  > > >-----Original Message-----
> >>  > > >From: Edward A. Lee [mailto:eal at eecs.berkeley.edu]
> >>  > > >Sent: Friday, January 03, 2003 5:10 PM
> >>  > > >To: Fons, Richard
> >>  > > >Cc: 'ptolemy-hackers at ptolemy.eecs.berkeley.edu'
> >>  > > >Subject: Re: Ptolemy II under Mac OS X
> >>  > > >
> >>  > > >
> >>  > > >
> >>  > > >Control-L will perform look inside as well...  However,
> >>  > > >this workaround is really no good, since we rely on you
> >>  > > >being able to see the context menu to document the
> >>  > > >shortcut...
> >>  > > >Any suggestions about how to fix this?
> >>  > > >
> >>  > > >Edward Lee
> >>  > > >

> >>  > > >At 12:17 PM 1/3/2003 -0500, Fons, Richard wrote:
> >>  > > > >I did a web start install of Ptolemy II under Mac OS
> >>  > > > >10.2.3 and everything went smoothly.  While
> >>  > > > >experimenting with Simple Signal Processing under
> >>  > > > >Quick Tour, I discovered that I was unable to "Look
> >>  > > > >Inside" the hierarchical blocks (e.g. "Signal Source")
> >>  > > > >since there is no right mouse button on my mouse.
> >>  > > > >Normally contextual (popup) menus on a Mac are brought
> >>  > > > >up by control-clicking, but control-clicking in
> >>  > > > >Ptolemy II is defined to create a new relation. Does
> >>  > > > >anyone have a work around?  Is there another way to
> >>  > > > >access the Look Inside function besides the popup?  Is
> >>  > > > >there way to dissociate the control-click from the
> >>  > > > >"create new relation" action, so that the Mac could
> >>  > > > >use the control-click to trigger the contextual
> >>  > > > >(popup) menu?
> >>  > > > >
> >>  > > > >Regards,
> >>  > > > >
> >>  > > > >Dick Fons
> >>  > > > >
> >>  > > > >American Superconductor
> >>  > > > >Power Electronic Systems
> >>  > > > >15775 West Schaefer Court
> >>  > > > >New Berlin,  WI   53151
> >>  > > > >
> >>  > > > >PH:  262-901-6000 (switchboard)
> >>  > > > >FAX: 262-901-0100
> >>  > > > >
> >>  > > > >PH:  262-901-6006 (direct)
> >>  > > > >
> >>  > > > >rfons at amsuper.com
> --------
> 
>     
>     
>     Wouldn't it be possible to define configuration files that specificy
>     what action is executed on what mouse event?
>     
>     I remember the good old X-windows days when one could very easily
>     define in the .twm or .fvwm what menus would pop up for certain
>     interaction events and what was supposed to happen..
>     
>     I guess the lucky linux users still know how all this works... 
>     
>     Maybe a similar config. mechanism could be included in
>     Ptolemy/Kepler!?
>     
>     Bertram
>     
>  >>>>> "EAL" == Edward A Lee <eal at eecs.berkeley.edu> writes:
>     EAL> 
>     EAL> We have had endless discussions about this with the net
>     EAL> effect that we can think of no solution that works...
>     EAL> 
>     EAL> If someone proposes something that works (and provides
>     EAL> all the needed functionality on Mac, Windows, and Linux),
>     EAL> we will gladly implement it.
>     EAL> 
>     EAL> Edward
>     EAL> 
>     EAL> At 08:51 AM 4/26/2004 -0700, Xiaowen Xin wrote:
>  >> Hi Everyone,
>  >> 

>  >> Some of the functionality of Ptolemy II can only be enabled
>  >> through right-clicking I believe.  For example, the context
>  >> menu of an actor in a workflow can only be brought up through
>  >> right-clicking on that actor.  Since currently, the major
>  >> customer for SPA is a Mac user and Macs have only one mouse
>  >> button, is there a different way that he can enable that
>  >> functionality?
>  >> As far as I can tell, right-clicking can normally be emulated
>  >> on Macs through control-clicking, but in Ptolemy II,
>  >> control-clicking creates a new relation.
>  >> 
>  >> Thanks!
>  >> Xiaowen



More information about the Kepler-dev mailing list