With the modifier keys alt
, ctrl
, and shift
, you can use event modifiers specifically for them:
$(".f1").click(function() {
var e = jQuery.Event("keydown");
e.which = 112; // # F1 code value
e.altKey = true; // Alt key pressed
$("input").trigger(e);
});