var e = jQuery.Event("keydown");
e.which = 50; // # Some key code value
$("input").trigger(e);