I have the following problem: I deal with a key event, I need to create a new modified key event (since the keyCode property is read-only), and then it processes the newly created KeyEvent. I came across a few old posts in StackOverflow where similar situations are handled, but:
I need this to work under Webkit / there is a solution here in StackOverfow, but it only works in Gecko /
I need to create another KeyEvent, but not TextInputEvent, since TextInputEvent will only allow me to specify the string to be inserted, while I cannot do this, because I use a third-party tool that should handle this event and I need a key code.
I tried jQuery#trigger(), but this will not work for me. My code is as follows
var event = jQuery.event('keydown');
event.which = 13;
$('iframe').contents().find('document').find('body').trigger(event);
source
share