Hi,

If you want to know whether the control key was down when the mouse
was clicked, then yes, the ctrlKey property of the mouse click event
object is what you want.

    element.observe('click', function(event) {
        if (event.ctrlKey) {
            // Something cool here
        }
    }

https://developer.mozilla.org/en/DOM/event.ctrlKey

If you're looking to receive an event (separate from the click) when
the control key is pressed, that varies quite a bit by browser:
http://unixpapa.com/js/key.html

But my impression is that you're just looking for it when the mouse is
clicked, which is much more reliable.

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available

On Aug 25, 12:09 am, Ooypunk <ooyp...@gmail.com> wrote:
> Hi,
>
> I was looking for a way to capture a mouse-click plus ctrl-button. As
> I am using Prototype now for some time (it's great!), I thought
> Prototype could help me with this too.
> Sure, the manual is clear enough of how to capture a mouse-click event
> (that works fine here), but how about the ctrl-button? According to
> the manual, there's a list of key codes to be used (KEY_DOWN, for
> example), but there is no KEY_CTRL and there is nowhere to be found
> how they should be used.
> It says it's self explanatory, but for me it isn't. :(
>
> I think I can get it to work with event.ctrlKey, but I have a feeling,
> this is not the way.
>
> Thanks in advance.
>
> Ooypunk
>
> PS. I hope I made my problem clear enough, I know I'm not very good at
> explaining, especially because english is not my mother tongue.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to