From: Bernhard Tittelbach <xro@realraum.at> Date: Thu, 29 Jul 2010 22:40:47 +0000 (+0000) Subject: ir remote image map X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=80032eb297f006d43491a29f96bc4a003ca45fce;p=svn42.git ir remote image map --- diff --git a/powersensordaemon/rx-v396-remote.png b/powersensordaemon/rx-v396-remote.png new file mode 100644 index 0000000..d117511 Binary files /dev/null and b/powersensordaemon/rx-v396-remote.png differ diff --git a/powersensordaemon/switch.cgi b/powersensordaemon/switch.cgi index ffa428e..1565c53 100755 --- a/powersensordaemon/switch.cgi +++ b/powersensordaemon/switch.cgi @@ -17,7 +17,7 @@ done UNIXSOCK=/var/run/powersensordaemon/cmd.sock VALID_ONOFF_IDS="decke ambientlights lichter all werkzeug labor dart logo idee deckehinten deckevorne" -VALID_SEND_IDS="ymhpoweron ymhpoweroff ymhvolup ymhvoldown ymhcd ymhwdtv ymhtuner ymhvolmute ymhmenu ymhplus ymhminus ymhtest ymhtimelevel ymheffect ymhprgup ymhprgdown ymhtunplus ymhtunabcde ymhtape ymhvcr ymhextdec" +VALID_SEND_IDS="ymhpoweron ymhpoweroff ymhpower ymhvolup ymhvoldown ymhcd ymhwdtv ymhtuner ymhvolmute ymhmenu ymhplus ymhminus ymhtest ymhtimelevel ymheffect ymhprgup ymhprgdown ymhtunplus ymhtunabcde ymhtape ymhvcr ymhextdec" [ "$POWER" == "send" ] && POWER=on @@ -51,6 +51,7 @@ DESC_lichter="Alle Lichter" DESC_all="Alles" DESC_ymhpoweron="Reciever On" DESC_ymhpoweroff="Reciever Off" +DESC_ymhpower="Reciever On/Off" DESC_ymhvolup="VolumeUp" DESC_ymhvoldown="VolumeDown" DESC_ymhcd="Input CD" @@ -78,6 +79,7 @@ echo "<title>Realraum rf433ctl</title>" echo "</head>" echo "<body>" #echo "<h1>Realraum rf433ctl</h1>" +echo "<div style=\"float:left; border:1px solid black;\">" for DISPID in $VALID_ONOFF_IDS; do NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID @@ -89,6 +91,8 @@ for DISPID in $VALID_ONOFF_IDS; do echo "</span></div>" echo "</form>" done +echo "</div>" +echo "<div style=\"float:left; border:1px solid black;\">" for DISPID in $VALID_SEND_IDS; do NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID @@ -99,5 +103,6 @@ for DISPID in $VALID_SEND_IDS; do echo "</span></div>" echo "</form>" done +echo "</div>" echo "</body>" echo "</html>" diff --git a/powersensordaemon/ymhremote.html b/powersensordaemon/ymhremote.html new file mode 100755 index 0000000..954025a --- /dev/null +++ b/powersensordaemon/ymhremote.html @@ -0,0 +1,99 @@ +<html> +<head> +<title>Realraum Yamaha Remote</title> +<script type="text/javascript"> + +function sendButton( btn ) +{ + //alert(btn); + var req = new XMLHttpRequest(); + url = "http://slug.realraum.at/www/cgi-bin/switch.cgi?power=send&id="+btn; + req.open("GET", url ,false); + req.send(null); +} + +function remoteKeyboard( e ) +{ + e = e || window.event; + switch( e.keyCode ) + { + //case 81: sendButton( ( e.altKey ? 'REBOOT' : 'w' ) ); break; // ALT-Q = reboot, Q = Power + case 38: sendButton( 'ymhprgup' ); break; //up + case 37: sendButton( 'ymhminus' ); break; //left + //case 13: sendButton( '' ); break; //enter + case 39: sendButton( 'ymhplus' ); break; //right + case 40: sendButton( 'ymhprgdown' ); break; //down + //case 8: sendButton( 'T_back' ); break; //backspace + //case 27: sendButton( 't_stop' ); break; // ESC + case 77: sendButton( 'ymhmenu' ); break; // M + case 84: sendButton( 'ymhtimelevel' ); break; // T + //case 32: sendButton( '' ); break; // Space + case 83: sendButton( 'ymhsleep' ); break; // S + case 36: sendButton( 'ymhmute' ); break; //pos1 + case 33: sendButton( 'ymhvolup' ); break; // P = 80, PAGEUP = 33 + case 34: sendButton( 'ymhvoldown' ); break; // N = 78, PAGEDOWN = 34 + case 43: sendButton( 'ymhtunplus' ); break; // + + case 65: sendButton( 'ymhtunabcde' ); break; // A + case 69: sendButton( 'ymheffect' ); break; // E + case 80: sendButton( 'ymhpower' ); break; // P + case 48: sendButton( 'ymhtest' ); break; // 0 + case 49: sendButton( 'ymhcd' ); break; // 1 + case 50: sendButton( 'ymhtuner' ); break; // 2 + case 51: sendButton( 'ymhtape' ); break; // 3 + case 52: sendButton( 'ymhwdtv' ); break; // 4 + //case 53: sendButton( 'ymhsat' ); break; // 5 + case 54: sendButton( 'ymhvcr' ); break; // 6 + //case 55: sendButton( '' ); break; // 7 + case 56: sendButton( 'ymhaux' ); break; // 8 + case 57: sendButton( 'ymhextdec' ); break; // 9 + } +} + +document.onkeydown = remoteKeyboard; + + +</script> +</head> +<body> + +<img src="rx-v396-remote.png" width="180" height="941" usemap="#ymhremote" /> + +<map name="ymhremote"> +<area shape ="rect" coords ="57,193,121,216" onClick="sendButton('ymhpower');" /> + +<area shape ="circle" coords ="36,255,17" onClick="sendButton('ymhcd');" alt="ymhcd" /> +<area shape ="circle" coords ="88,255,17" onClick="sendButton('ymhtuner');" alt="ymhtuner" /> +<area shape ="circle" coords ="142,255,17" onClick="sendButton('ymhtape');" alt="ymhtape" /> +<area shape ="circle" coords ="36,302,17" onClick="sendButton('ymhwdtv');" alt="ymhwdtv" /> +<!--area shape ="circle" coords ="88,302,17" onClick="sendButton('ymhsat);" alt="ymhsat" /--> +<area shape ="circle" coords ="142,302,17" onClick="sendButton('ymhvcr');" alt="ymhvcr" /> +<!--area shape ="circle" coords ="36,349,17" onClick="sendButton('ymh7);" alt="ymh7" /--> +<area shape ="circle" coords ="88,349,17" onClick="sendButton('ymhaux');" alt="ymhaux" /> +<area shape ="circle" coords ="142,349,17" onClick="sendButton('ymhextdec');" alt="ymhextdec" /> +<area shape ="circle" coords ="36,397,17" onClick="sendButton('ymhtest');" alt="ymhtest" /> +<area shape ="circle" coords ="88,397,17" onClick="sendButton('ymhtunabcde');" alt="ymhtunabcde" /> +<area shape ="circle" coords ="142,397,17" onClick="sendButton('ymheffect');" alt="ymheffect" /> + +<!--area shape ="polygon" coords ="57,493,89,465,119,490,110,502,66,502" onClick="sendButton('ymhtvlolup');" alt="ymhtvlolup" /--> +<!--area shape ="polygon" coords ="57,575,66,564,110,564,119,575,89,603" onClick="sendButton('ymhtvvoldown');" alt="ymhtvvoldown" /--> +<area shape ="polygon" coords ="19,534,47,503,59,512,59,555,47,565" onClick="sendButton('ymhvolup');" alt="ymhvolup" /> +<area shape ="polygon" coords ="118,512,129,503,158,534,130,565,118,555" onClick="sendButton('ymhvoldown');" alt="ymhvoldown" /> +<area shape ="circle" coords ="89,534,16" onClick="sendButton('ymhmute');" alt="ymhmute" /> + +<area shape ="circle" coords ="36,602,17" onClick="sendButton('ymhsleep');" alt="ymhsleep" /> +<!--area shape ="circle" coords ="142,602,17" onClick="sendButton('ymhdsp');" alt="ymhdsp" /--> + +<!--area shape ="rect" coords ="18,435,67,458" onClick="sendButton('ymhminus');" /--> +<area shape ="rect" coords ="111,435,160,458" onClick="sendButton('ymhtunplus');" /> + +<area shape ="polygon" coords ="57,681,89,653,119,678,110,690,66,690" onClick="sendButton('ymhprgup');" alt="ymhprgup" /> +<area shape ="polygon" coords ="57,763,66,752,110,752,119,763,89,791" onClick="sendButton('ymhprgdown');" alt="ymhprgdown" /> +<area shape ="polygon" coords ="19,722,47,691,59,700,59,743,47,753" onClick="sendButton('ymhminus');" alt="ymhminus" /> +<area shape ="polygon" coords ="118,700,129,691,158,722,130,753,118,743" onClick="sendButton('ymhplus');" alt="ymhplus" /> + +<area shape ="circle" coords ="36,789,17" onClick="sendButton('ymhtimelevel');" alt="ymhtimelevel" /> +<area shape ="circle" coords ="142,789,17" onClick="sendButton('ymhmenu');" alt="ymhmenu" /> +<!-- href ="./cgi-bin/switch.cgi" target ="_blank" --> + +</map> +</html> \ No newline at end of file