Thanks Martin,

I wasn't sure how to quickly assign the onBlur to the applet itself without 
editing Jmol.js, but your suggestion gave me an idea that works on Firefox and 
MSIE. I'm trying to get the keystroke capture back to the page after an model 
is clicked. Using your thought, I used pickcallback do the following:

document.getElementById("script").blur(); 
document.getElementById("script").focus(); 
document.getElementById("script").blur();

The element "script" is a field on the page. Interestingly, all three method 
calls are required for what I need. The focus() by itself does not work. It 
needed to be preceded by the blur(). The final blur() is inserted so subsequent 
key pressing does not mess up my field contents. The net result is that after 
an atom click, key capture is returned to the page.

Otis


--
Otis Rothenberger
o...@chemagic.com
http://chemagic.com




On Jun 26, 2012, at 2:54 AM, Martin Hediger wrote:

> maybe you could also assign an onBlur event to the Jmol applet and so when 
> Jmol goes out of focus, the onBlur event fires, assigning a keystroke capture 
> back to the element you want. Maybe not super elegant, but could fix for the 
> moment.
> 
> Martin
> 
> 
> 
> 
> 
> On 25.06.12 21:31, Otis Rothenberger wrote:
>> Bob,
>> 
>> I'm setting up some keystroke capture JavaScript to control page activity. 
>> I'm placing the event capture function call in the body tag of the page, and 
>> this works well until I click inside the applet. After an applet click, I 
>> must click on a page link or inside a page field to reinitiate the page 
>> keystroke capture. Clicking the page itself does not reinitiate the capture.
>> 
>> I suspect that this is a general applet issue. Is there any way within 
>> JmolScript to reinitiate this page JavaScript behavior?
>> 
>> Otis
>> 
>> 
>> --
>> Otis Rothenberger
>> o...@chemagic.com
>> http://chemagic.com
>> 
>> 
>> 
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and 
>> threat landscape has changed and how IT managers can respond. Discussions 
>> will include endpoint security, mobile security and the latest in malware 
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> 
>> 
>> _______________________________________________
>> Jmol-users mailing list
>> Jmol-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. 
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to