[thelist] trapping keyboard combo on Mac OSX

liorean liorean at f2o.org
Thu Feb 19 01:25:06 CST 2004


Scott Blanchard wrote:
> I need to trap CTRL+8 keyboard combination in Gecko/Mozilla on a Mac 
> (OSX 10.2). Here's my code to do it on PC...
> 
> document.onkeydown = checkHandles;
> function 
> checkHandles(e){if(document.all){e=window.event;}if((e.ctrlKey)&&(e.keyCode==56)){if(session){doHandles()}else{doLogin()}}}  

If you change
     if(document.all){e=window.event;}
to
     e=e||window.event;
it SHOULD work.

-- 
David "liorean" Andersson

ViewStyles, ViewScripts, SwitchStyles and GraphicsInfo bookmarklets:
<http://liorean.web-graphics.com/>
Hangouts:
<http://codingforums.com/> <http://yourmusicforums.com/>


More information about the thelist mailing list