Hi there, Does the "if(e.ctrlKey) {" apply also for Macs? I know a Mac doesn't have a Ctrl key as such, but it has some key that allows for multiple selections of things.
- Dave On Sep 11, 2:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Just do something like this: > > $(document).click(function(e) { > if(e.ctrlKey) { > console.log("Ctrl+Click"); > // your code goes here... > } else if(e.altKey) { > console.log("Alt+Click"); > } else if(e.shiftKey) { > console.log("Shift+Click"); > } > > }); > > I have just add 2 other events > > On 11 Sep., 21:28, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > Thanks both for your input. I guess the question is, there cleraly > > seems to be a way to detect if a key is pressed, and there is a way to > > define a click event, but how would I do a combination? > > > Is the easiest way to capture the event when the Ctrl key is pressed, > > set a flag, and check if that flag is still set when I catch the mouse > > click event? > > > - Dave > > > On Sep 11, 7:37 am, owen <[EMAIL PROTECTED]> wrote: > > > > I've had some success with the hotkeys plugin: > > > >http://code.google.com/p/js-hotkeys/ > > > > Check out the demo:http://jshotkeys.googlepages.com/test-static-01.html > > > > -- Owen- Hide quoted text - > > - Show quoted text -