Author Topic: Does a Mouse.Click should trigger a on_mouse_click event?  (Read 105 times)

Does a Mouse.Click should trigger a on_mouse_click event? If they are in different modules, does order matter? Does Mouse.Click holds button down (for Mouse.isButtonDown) for a single tick?

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Does a Mouse.Click should trigger a on_mouse_click event?
Yes, it should.

If they are in different modules, does order matter?
No order should not matter, and the click is handled not immediately, but at the next engine update.

Does Mouse.Click holds button down (for Mouse.isButtonDown) for a single tick?
No, it does not save button state.

Currently Mouse.Click works through same hack plugin's SimulateMouseClick works. It also allows one button at update.

Thanks CW! I was doing some testing, and Mouse.Click indeed trigger and order does not matter. Only weird behaviour I had was that once on_mouse_click captures,and proceeds to trigger different Room.ProcessClick, the one that did Room.ProcessClick(mouse.x,mouse.y,eModeWalkto) wasn't making the player walk while all other eMode were working.

But I think it was a problem with some other module. So now knowing the intended behaviour I think I solved it - it was some other function that checked for isButtonDown that had no button down.