shortcut for tare

This commit is contained in:
Tarun Pemmaraju 2015-12-10 16:42:36 +00:00
parent 78b2fc74bf
commit 183f727085

View file

@ -94,12 +94,20 @@
//Remove the TareValue from the returned value //Remove the TareValue from the returned value
forceTextElement.innerHTML = Math.round((ForceValue * 385) - TareValue) + " grams"; forceTextElement.innerHTML = Math.round((ForceValue * 385) - TareValue) + " grams";
} }
function tareShortcut(e) {
// this would test for whichever key is 116 and the ctrl key at the same time
if (e.ctrlKey && e.keyCode == 116) {
// call your function to do the thing
pauseSound();
}
}
(function() { (function() {
touchElement.addEventListener('touchstart', onTouchStartMove, false); touchElement.addEventListener('touchstart', onTouchStartMove, false);
touchElement.addEventListener('touchmove', onTouchStartMove, false); touchElement.addEventListener('touchmove', onTouchStartMove, false);
touchElement.addEventListener('touchend', onTouchEnd, false); touchElement.addEventListener('touchend', onTouchEnd, false);
touchElement.addEventListener('webkitmouseforcewillbegin', checkMacForce, false); touchElement.addEventListener('webkitmouseforcewillbegin', checkMacForce, false);
touchElement.addEventListener('webkitmouseforcechanged', checkMacForce, false); touchElement.addEventListener('webkitmouseforcechanged', checkMacForce, false);
document.addEventListener('keyup', tareShortcut, false);
})(); })();
</script> </script>
</body> </body>