Only the JavaScript version.

On Wed, Mar 29, 2017 at 11:32 AM, Rolf Huehne <rolf.hue...@leibniz-fli.de>
wrote:

> Am 29.03.17 um 18:21 schrieb Robert Hanson:
> > David,
> >
> > OK, so the beauty of this system is that you can implement any sort of
> > additional functionality you want using readily available methods that
> > have nothing to do with Jmol or JSmol. It's one of the bonuses of
> > working in JavaScript and jQuery.
> >
> > So, for example, if you want to implement a key listener that
> > implements  + and - to actuate zooming, you can do it this way:
> >
> > c = $("#jmolApplet0_canvas2d")
> > c.attr("tabindex", 1)
> > c.mouseover(function(){c.focus()})
> > c.keypress(function(e){
> >   if (e.key == "+")Jmol.script(jmolApplet0, "zoom *1.2")
> >   else  if (e.key == "-")Jmol.script(jmolApplet0, "zoom /1.2")
> > })
> >
> > Notice that to accept key events, we must (a) provide a tabindex to the
> > canvas and (b) make sure the canvas has focus when we are looking for
> > key events.
> >
> > I would only say that hidden specialized features like this, though
> > potentially useful, are not necessarily recommended.
> > ​
> It looks like the example would only work for the Javascript version. Or
> could it also work for the Java version (with some adjustment)?
>
> Regards,
> Rolf
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to