I need to simulate a key press. However I have just been able to find this:
var press = jQuery.Event("keypress");
press.ctrlKey = false;
press.which = 75;
$("whatever").trigger(press);
Where "whatever" is an input field or something. However I don't need to target any element. How can I simulate a key press (the 'k' key to be specific) without targeting any element?