Open GoogleCodeExporter opened 9 years ago
Key events should work fine _except_ on the document itself because there are
issues with making it possible to focus there. You should be able to use them
on any form field, or any element made focusable using tabindex.
Simple example to test with:
<div onkeypress="this.textContent += ' ' + event.keyCode" tabindex="0">
Click me and type
</div>
Original comment by kpreid@google.com
on 10 Sep 2014 at 4:42
Thank you very much. Do you know if it is possible to then focus that element
on page load so it works automatically? I can't seem to get this example to
work:
https://caja.appspot.com/#http://pastebay.net/pastebay.php?dl=1492607
Original comment by jsc...@gmail.com
on 13 Sep 2014 at 11:08
No. Caja specifically does not allow guest content to steal focus from the host
page, because that could be abused (not in the Apps Script case, I suppose, but
it's a generic policy at the moment). However, you can use .focus() in reaction
to any user event (e.g. a click on any element or the virtual document).
Original comment by kpreid@google.com
on 15 Sep 2014 at 4:26
Original issue reported on code.google.com by
jsc...@gmail.com
on 10 Sep 2014 at 2:08