ONDOWN vs ONCLICK some confusion here

  • Hello folks, I've had this doubt for a while, ¿can anybody explain me what is the difference between using the ONDOWN event and the ONCLICK event?

    Documentation states this:

    ONCLICK : Actions / functions that will be called when there is a mouse click on the layer/plugin element.
    ONDOWN: Actions / functions that will be called when the mouse button will be pressed down on the layer/plugin element.

    I can't figure out what's the difference between a mouse click and a mouse button pressed down, ¿does it means ONDOWN element extends click for every mouse's button?

    Klaus, if you read me, I'll sugest you to clarify better the difference in the documentation, I find it confusing.

    Thanks in advance

    Luis

  • Hi,

    the ondown-event does not need the release (onup) of the mouse-button to work. This means you can use the ondown for usefull things like checking if the mouse button is released (onup) at the same position or not to start different actions. I use the ondown and onup-event excessively and additional to the onclick-event in my tours. It´s a great-to-have-thing *smile*

    LG
    Nupsi

  • Hi,

    click = mouse-button-down (or touch-down) + (at least) no movement + mouse-button-up (or touch-release)

    Just image that you can hold the mouse button down to do something, just with an onclick event alone this would be not possible - e.g. start something on the ondown event and do it as long until the onup event comes...

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!