I'd like to write some simple javascript as a music page-turner. I've got it working fine with mouse events, but my wife isn't deft enough to click a mouse with her foot while she's playing piano. Keyboards, being bigger and less inclined to move around, seem like a better solution, but I can't get the keyboard events to catch after the first pagedown.
In the test case the mouse "click" events are caught and the pages advance but the "keydown" events are not caught. However, if I comment out the last line of the advanceLeft() and the advanceRight() functions (so that the iframe content is not reloaded), then the keydown events are caught. Of course then the new content is not visible. What's happening and how can I get around it?
HTML file here
test PDF file here
ZIP file here (just the two above files)