Hi Bob, here is what I tried:
bind "ALT-LEFT" "javascript jmol_center(_X, _Y, _picked);"; bind "ALT-LEFT" "javascript jmol_center(_X, _Y, _atomPicked);"; _X and _Y are replaced with the screen coordinates where the click happened, but _picked or _atomPicked are not replaced by anything. And 'jmol_center' is just some javascript function which gets correctly called. This does not work ether: bind "ALT-LEFT" "print _X; print _Y; print _picked; print _pickedAtom;"; it just print _X and _Y. Alex ----- Ursprüngliche Mail ----- > Von: "Bob Hanson" <hans...@stolaf.edu> > An: jmol-users@lists.sourceforge.net > CC: jmol-users@lists.sourceforge.net > Gesendet: Freitag, 20. Januar 2012 18:20:38 > Betreff: Re: [Jmol-users] bind command and picked atoms > _picked is a variable. I thought it was defined prior to the callback. > > Sent from my stupid iphone > > On Jan 20, 2012, at 10:35 AM, Alexander Rose > <alexander.r...@weirdbyte.de> wrote: > > > Hi all, > > > > when using Jmol I find myself using either 'set picking CENTER' or > > 'set picking SELECT GROUP', so I would like to switch as fast and > > easy as possible between the two modes via the mouse. My first idea > > was to use the 'bind' command to bind centering to "ALT-LEFT" and > > selecting a group to "LEFT". However there is no "_center" > > jmol-action for the bind command and the "_select" jmol-action seems > > not to work when 'set picking CENTER' is active. The bind command > > also allows to pass a jmol "script" instead of a jmol-action, but > > inside that passed script the information which atom was picked is > > not available so you can't center on it or select its group. There > > is also the pick callback, but this does not give you the modifier > > key that was pressed when the atom was picked. > > > > In my opinion the addition of a "_centerOnPickedAtom" jmol-action > > for the bind command would be useful. A more flexible solution would > > be to add a "_PICKED" variable (containing a selection of the picked > > atom; maybe also other pickable elements?!) to the things that gets > > replaced in a script passed to 'bind' command. Based on that > > variable it is straightforward to implement centering or selecting a > > group. What do you think? Would anyone else find this useful, too? > > > > > > Best > > Alexander > > > > ------------------------------------------------------------------------------ > > Keep Your Developer Skills Current with LearnDevNow! > > The most comprehensive online learning library for Microsoft > > developers > > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, > > MVC3, > > Metro Style Apps, more. Free future releases when you subscribe now! > > http://p.sf.net/sfu/learndevnow-d2d > > _______________________________________________ > > Jmol-users mailing list > > Jmol-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/jmol-users > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft > developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, > MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Jmol-users mailing list > Jmol-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jmol-users ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users