Is it possible with jQuery to automatically simulate a press on a keyboard, f.ex. inside an html input field?
As explanation: If I press the a inside an
trigger does help, because it fires an event...and that is the only thing you are interested in browser...everything before that is a matter of OS (which you cannot reach, since you are building inside a browser...unless you build some activeX control). So, this should work:
var e = $.Event("keypress");
e.which = ;
$("").trigger(e);
As you can see here keypress event is sent when browser registers keyboard input. Difference between keypress and keydown is: "If the user presses and holds a key, a keydown
event is triggered once, but separate keypress
events are triggered for each inserted character...". You can decide which one you will use depending on your use case.