I have written a html+css+javascript application, which simulates a presentation software (like powerpoint, keynote, prezi or similar), because I wanted to create some custom effects that are hard to create in such tools.
When I use Powerpoint (on my Apple MacBook), it works perfect together with Apples Remote control (this guy: Apple Remote). A click on the right-arrow lets Powerpoint display the next slide (or the next animation within a slide) while a click on the left-arrows brings me back one step.
Now I want to use this remote control in exactly the same way within my web browser (I'm using Google Crome, but any browser will do), using JavaScript+jQuery.
My website-presentation already correctly reacts on the arrow-keys on my keyboard using these lines of code:
$('body').on('keydown',function(event) {
event.preventDefault();
oldframe = frame;
if ( event.which == 37 ) {//left
frame--;
}
if ( event.which == 38 ) {//up
frame--;
}
if ( event.which == 39 ) {//right
frame++;
}
if ( event.which == 40 ) {//down
frame++;
}
if (frame < 0) {frame = 0;}
if (frame > (frames.length - 1)) {frame = frames.length - 1;}
if (oldframe != frame) {gotoFrame(frame);}
});
My Questions:
- Is it posible, to catch events form Apple Remote within a Webbrowser using JavaScript?
- If yes: How? (using Javascript + jQuery)
I just know, that Apple Remote doesn't fire keydown-events, nor does it fire click-events. I have no idea which kind of events it fires, and if the browser is even aware of them.