I have done it several times already in fact.

What you have to do is add another global keydown event to the
document, in which you then have to check for e.ctrlKey and save the
boolean to a scoped variable your click event can access.
Now add another keyup event, were you set your boolean to false again.
That's it.

Paul

2007/2/8, Stefan Kilp [sk-software] <[EMAIL PROTECTED]>:
> hi,
>
> is it possible to distinguish between a click with or without a ctrl/alt key 
> pressed.
>
>
> i want to simulate "selecting items" with Ctrl+click and click only to 
> execute an action.
>
>
> $("p").bind("click", function() {
>
>         // how to find out what keys where pressed
>         if (ctrl-pressed) {
>                 start select action
>         }
>         else {
>                 start normal action
>         }
> })
>
>
> thanks
> stefan
>
>
>
>
>
> --
> Stefan Kilp
> SK-Software, Entwicklung & Beratung
>
> email: [EMAIL PROTECTED]
>
> fon  : +49 6151 93344-0
> fax  : +49 6151 93344-20
> Herta-Mansbacher-Str. 98
> 64289 Darmstadt, Germany.
> -----------------------------------------------------
>
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>


-- 
--
Paul Bakaus

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to