I need to simulate keyboard in google docs with using JavaScript to be able print or erase characters on cursor position.
Unfortunately solutions with simulating keypress event didn't work for me. I tried with and without jQuery.
After some investigation I detected that Google Docs have virtual keyboard. Clicks on virtual keys calls this function:
C.MOa = function(a) {
this.dispatchEvent(new Q(Td, {keyCode: a}))
};
Where Td
is a string "action" and Q
some Event class.
What is the correct way to send this event with java script? Is there other ways to simulate keyboard in Google Docs?
$(elm).trigger(yourEvent)
are no real events and do not do real DOM bubbling (at least the last time I looked into jQuery), cause of that those event are only detected by jQuery itself. – Sedberry