The basic outline is:
document.body.addEventListener("keydown", function (event) {
if (event.keyCode === 70) { // 70 = f
document.getElemenById("formforpigs").submit();
}
});
You could set up the keydown listener to listen to all kinds of keys and shortcuts, making it more modular is also a good idea.