Created
June 14, 2012 08:23
-
-
Save vicro/2928986 to your computer and use it in GitHub Desktop.
Toggle rikaichan with FireGestures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Send the keystroke for toggling | |
* Rikaichan | |
*/ | |
var event = document.createEvent("KeyboardEvent"); | |
event.initKeyEvent( | |
"keypress", //Key code | |
true, // in boolean canBubbleArg, | |
true, // in boolean cancelableArg, | |
null, // in nsIDOMAbstractView viewArg, Specifies UIEvent.view. This value may be null. | |
false, // in boolean ctrlKeyArg, | |
true, // in boolean altKeyArg, | |
false, // in boolean shiftKeyArg, | |
false, // in boolean metaKeyArg, | |
event.DOM_VK_INSERT, // in unsigned long keyCodeArg, (Insert key) | |
event.DOM_VK_INSERT // in unsigned long charCodeArg); | |
); | |
document.documentElement.dispatchEvent(event); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment