PDA

View Full Version : how to simulate keydown event by javascript in QWebView



catchxiaoshuang
16th June 2015, 14:13
I use QWebView to open a webpage, and i want to simulate keydown event to input a string into a input element by javascript.
I search in google, and has tried simulating-keydown-event-in-chrome (http://stackoverflow.com/questions/29312143/simulating-keydown-event-in-chrome) and simulate-javascript-key-events (http://stackoverflow.com/questions/596481/simulate-javascript-key-events/12187302#12187302),
but they all don't work for me.

Is there someone can give me a work javascript code or other useful information?
thanks in advance.