Am 28.03.17 um 17:55 schrieb David Hibbitts:
> I would like to add keyboard shortcuts to my web application. I can do
> this with javascript without any issue using something like Mousetrap
> and I can interact with jsmol via jmolScript calls.
>
> The issue comes when using the Java version (which I still use via
> Waterfox because I'm stubborn and it is faster).
>
> The jmol applet in the Java version seems to trap all keystrokes and
> pass nothing to the underlying browser while the jmol applet has focus
> -- is there any way to have the jmol applet pass all unbound keystrokes
> to the browser?
>
> Alternatively, is there a way to have jmol call custom functions
> whenever a key is pressed? If so I can just define the keyboard
> shortcuts in both Mousetrap and jmol.
>
> I attempted to play with set allowKeystrokes and set showKeyStrokes but
> I didn't really get anywhere. allowKeystrokes just caused my applet to
> freeze and nothing but a refresh would bring it back. showKeystrokes
> didn't really work on my screen, although it's possible that the
> bottom-left corner of the applet is offscreen, set echo top left didn't
> change anything. Again my testing of allowKeystrokes and showKeystrokes
> was in the Java version of jmol using Waterfox.
>
David, on MacOS 10.11.6 with Waterfox 52.0 the command combination 'set 
allowkeystrokes; set showkeystrokes' does work for me in Jmol 14.9.1.

I could change for example the background color by typing "background 
yellow" and then press RETURN. And the text also appeared at the bottom 
left of the applet window. The whole process was terminated and the 
typed text ignored if I moved the mouse pointer.

But I think this is not quite what you would like to have, isn't it?

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

Reply via email to