[Project_owners] What's the differents between the events generated by keyboard and createEvent method?

fireinice fireinice at gmail.com
Sat Mar 8 10:09:00 PST 2008


I am writing a script to work with google reader. As we know google reader
has some shortkeys. And I want to use the codes below to simulate some
keystrokes to make some work automatically done.

    var event = document.createEvent('KeyboardEvent');
    event.initKeyEvent('keypress', true, true, null, false, false, true,
false, 0, character.charCodeAt(0));
    document.dispatchEvent(event);

The codes did fantastic work with google reader until about two days ago. It
seems like that google upgraded its codes. And the reader does not response
to this codes any more even "keyup" and "keydown" event. However, the
shortkeys are working as usual.
So what's the defferents between the event that generates from a literal
keystroke and one that creates by createEvent method in a javascript script?
How google codes can identify them?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mozdev.org/pipermail/project_owners/attachments/20080309/7fc2bd32/attachment.html 


More information about the Project_owners mailing list