Mouse button down for the frame

I was searching for the function in the mouse module, to find if the mouse button was down in current frame. I know there exist the orxMouse_IsButtonPressed() but this function does return the actual state of the button (true if the mouse button is pressed).
What I would need is to have function which will return true only when the mouse button was pressed, and false in subseqent frames when the mouse button is held down. That is I want find if the single click has happened.

Is it somehow possible with the current functions?



  • edited January 2015
    orxMouse_ functions wont give you that information.
    you need to use orxInput_ functions here is a sample.
    SetList = GameInput
    MOUSE_LEFT        = Action
    if(orxInput_IsActive("Action") && orxInput_HasNewStatus("Action"))
      ... // MOUSE_LEFT was just pressed
  • edited January 2015
    Thanks for reply,
    yes I have tried the input method and it kind of work.
    But was interested in mouse module. But will use the input method for now.
  • edited January 2015
    When you say "it kind of work", what are the issues you encountered?

    Querying directly the peripherals (with the tiny exceptions at the moment of multiple touches and cursor position) is usually not encouraged as the input system provides a more generic and flexible mechanism and allows for virtual inputs as well.

    There used to be mouse, keyboard and joystick events but they were removed over time.
  • edited January 2015
    No problem at all, but must redesign some code to be it more robust ;)
Sign In or Register to comment.