[Solved] Is it possible to distinguish between mouse "ondown" and "onclick" depending the clic duration ?

  • Hello everyone,

    Regarding mouse actions, do you know if it's possible to use both "onclick" and "ondown" at the same time ? What I mean is that I would need a different action to occur depending on whether the user performs a short click (single click) or a click with the button held down. The current behavior that I have, which seems entirely logical to me, is that my "ondown" action is taken into account followed by the action I mentioned for "onup". However, if I perform a simple click, since the scene called on "ondown" is a video, it doesn't have time to load, and the result of my simple click is not suitable at all. That's why I need to be able to distinguish between "onclick" and "ondown" to provide other instructions to krpano in the case of a simple click. I am using it for clicks on a hotspot.

    I have searched for hours on the web and on the forum, but I can't find any topic that addresses the question in these terms or anything similar. I may have searched incorrectly, but I've really spent a lot of time on this, including studying the documentation on "delayed" or anything related to time in krpano. I am reaching out to you because I have invested a lot of time in this topic, but I really can't find any leads. If someone could give me a little help, I would be truly grateful.

    Wishing you all a great weekend :)

    Edited once, last by gn0o0b (January 22, 2024 at 3:21 PM).

  • If some people end here later after googling, here is what I did.

    I added an "if" condition on the "onup", in my example the hotspot is supposed to load a video, so I check if the video was loaded. I imagine you could do the same thing by mesuring time for other purposes.

    Code
        <action name="click_ordown" scope="global">
            if(plugin[video].isvideoready, mouse_down(), mouse_click() );
        </action>
  • Thanks Klaus,I think what I wanted to do wasn't possible by just using "ondown" and "onclick" (which seems logic), as mentionned yesterday I managed to have it working with "if" (krpano is so powerfull, I dream I could master it ^^). So the question is solved :)

  • gn0o0b January 22, 2024 at 3:21 PM

    Changed the title of the thread from “Is it possible to distinguish between mouse "ondown" and "onclick" depending the clic duration ?” to “[Solved] Is it possible to distinguish between mouse "ondown" and "onclick" depending the clic duration ?”.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!