Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable and timeout for mouse gesture

Status
Not open for further replies.

porman9

Programmer
Oct 30, 2009
1
GB
I use the Mouse Gesture Redox addon for Firefox 3.4 which allows javascript to be added for a gesture.
I have found code which will perform different commands for the same gesture when a particular key is pressed. I would like the code to be disabled after each key press or a timeout (if a key is not pressed) until the same gesture is performed again.
My attempts at coding to produce this have not worked.
Can this be achieved?
porman9

Code:
document.onkeypress=detectKey; 
function detectKey(e) 
{ 
if(e.which==97){BrowserOpenAddonsMgr();} 
else 
if(e.which==100){gBrowser.loadOneTab(currURL, null, null, null, false, false);document.body.focus();} 
else 
if(e.which==110){mgB_OpenTab();} 
else 
if(e.which==109){mgW_MinWin();} 
else 
if(e.which==114){mgW_Restart();} 
else 
if(e.which==117){mgB_UndoCloseTab();} 
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top