[jQuery] Re: Detecting Ctrl + click

2008-09-12 Thread [EMAIL PROTECTED]
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)

[jQuery] Re: Detecting Ctrl + click

2008-09-12 Thread BB
Just something I would like to add: if you now say: e.altKey doesn't work!! it is right... but will be fixed in the next release of jQuery, see: http://dev.jquery.com/ticket/2947 On 11 Sep., 22:10, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Just do something like this: > > $(document).click

[jQuery] Re: Detecting Ctrl + click

2008-09-11 Thread [EMAIL PROTECTED]
Just something I would like to add: if you now say: e.shiftKey doesn't work!! it is right... but will be fixed in the next release of jQuery, see: http://dev.jquery.com/ticket/2947 On 11 Sep., 22:10, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Just do something like this: > > $(document).cli

[jQuery] Re: Detecting Ctrl + click

2008-09-11 Thread [EMAIL PROTECTED]
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 1

[jQuery] Re: Detecting Ctrl + click

2008-09-11 Thread [EMAIL PROTECTED]
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 fl

[jQuery] Re: Detecting Ctrl + click

2008-09-11 Thread owen
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

[jQuery] Re: Detecting Ctrl + click

2008-09-11 Thread Andy Matthews
Should just be a matter of checking the keypress event: http://docs.jquery.com/Events/keypress#fn -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Wednesday, September 10, 2008 6:10 PM To: jQuery (English) Subject: [jQu

[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread Giovanni Battista Lenoci
Jeffrey Kretz ha scritto: Another way would be to use the ctrlKey property of the Click event: $('#element').click(function(e) { if (e.ctrlKey) { do_something(); } }); jQuery also normalizes this into the m

[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread andrea varnier
On 4 Feb, 17:20, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote: > Another way would be to use the ctrlKey property of the Click event: > > $('#element').click(function(e) > { > if (e.ctrlKey) > { > do_something(); > } >

[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread Jeffrey Kretz
On Behalf Of andrea varnier Sent: Monday, February 04, 2008 6:35 AM To: jQuery (English) Subject: [jQuery] Re: Detecting ctrl+click on an element On 4 Feb, 14:38, Giovanni Battista Lenoci <[EMAIL PROTECTED]> wrote: > The subject says it all... > > How I can detect a crtl+click on an eleme

[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread andrea varnier
On 4 Feb, 16:15, Giovanni Battista Lenoci <[EMAIL PROTECTED]> wrote: > I was making some test, and I have little problem.. > > If I bind a function to an element with jquery style method: > > $('#target').bind('click', function() { dosomething(this); ) }); > > in my dosomething function I can retr

[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread Giovanni Battista Lenoci
andrea varnier ha scritto: try this, supposing #target is yout target var clickFn = function(){ alert("ctrl + click"); $(this).unbind('click', clickFn); } $(document) .keydown(function(event){ if (event.keyCode == 17){ $("#target"

[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread Giovanni Battista Lenoci
andrea varnier ha scritto: try this, supposing #target is yout target var clickFn = function(){ alert("ctrl + click"); $(this).unbind('click', clickFn); } $(document) .keydown(function(event){ if (event.keyCode == 17){ $("#target"

[jQuery] Re: Detecting ctrl+click on an element

2008-02-04 Thread andrea varnier
On 4 Feb, 14:38, Giovanni Battista Lenoci <[EMAIL PROTECTED]> wrote: > The subject says it all... > > How I can detect a crtl+click on an element? try this, supposing #target is yout target var clickFn = function(){ alert("ctrl + click"); $(this).unbind('click', clickFn); } $(do