Video: http://ckyp.us/mLi+
Not all that smart yet, but a little jQuery with Hammer.js:
(function($){
window.scrollTo(0,1);
$("#cough")
.hammer({
prevent_default: true,
hold_timeout: 0
})
.bind("hold", function(ev) {
$.get('functions.php?func=coughon');
$(this).css({background:'red'});
})
.bind('release', function(ev) {
$.get('functions.php?func=coughoff');
$(this).css({background:'#478b35'});
});
})(jQuery);
and a PHP script:
<?php
switch ($_REQUEST['func'])
{
case "coughon":
exec("osascript -e 'set volume input volume 0'");
echo "Input Muted";
break;
case "coughoff":
exec("osascript -e 'set volume input volume 60'");
echo "Input restored";
break;
}
with some CSS/HTML and it's a go.