How to get mouse up events happening outside of mouse area

For general discussion related FlowStone
Post Reply
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

How to get mouse up events happening outside of mouse area

Post by tulamide »

The title says it. For eample, a view is used to move drawn objects around. If the user releases the mouse button, some calculations need to be done. Works, as long as the user releases the mouse button while inside the view area. But the mouse up event is not triggered if the mouse is released outside of that area.

I need a solution in green and I would want to avoid mouse move tracking via the mouse move prim, if possible. Any ideas?
"There lies the dog buried" (German saying translated literally)
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How to get mouse up events happening outside of mouse ar

Post by KG_is_back »

You provide the MouseArea primitive with view and area. You may input also areas that are outside the view.
It is quite inconsistent with mouse Ldown and Lup primitives. they work correctly when you interact with the module directly, but once the module is inside other module gui, it doesn't work any more. Mouse drag is the only way to go - sample and hold the coordinates on drag start and sample and hold on release.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How to get mouse up events happening outside of mouse ar

Post by tulamide »

Thanks a lot. I wasn't aware of the issues with LDo/LUp. I'll try your tip.

EDIT: Drag with s&h works perfectly. Thanks again!
"There lies the dog buried" (German saying translated literally)
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: How to get mouse up events happening outside of mouse ar

Post by tester »

Unfortunately there is no drag prims for right mouse button (RUp/RDo will have the same issues like left clickers)..
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How to get mouse up events happening outside of mouse ar

Post by tulamide »

tester wrote:Unfortunately there is no drag prims for right mouse button (RUp/RDo will have the same issues like left clickers)..

I wonder if ruby does have the same issues? If not it might be a good idea to use ruby for mouse messages.
"There lies the dog buried" (German saying translated literally)
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How to get mouse up events happening outside of mouse ar

Post by KG_is_back »

Unfortunately ruby behaves the same way as I have just tested it.
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: How to get mouse up events happening outside of mouse ar

Post by billv »

or you can put in another mouse up to account for when user moves past gui area...
mouse up cheating.fsm
(106.4 KiB) Downloaded 1168 times
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How to get mouse up events happening outside of mouse ar

Post by tulamide »

Thank you for the schematic. I confess that I don't understand why and how it works, since both ruby instances only activate isinmousepoint. Where are the booleans triggered?
"There lies the dog buried" (German saying translated literally)
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: How to get mouse up events happening outside of mouse ar

Post by billv »

The main module, goes True on Mouse down and false on mouse up...
The outer module, just has a false on mouse up, to account for user movement.
Downside is the mouse pointer will be 'activated' when over any part of outer module,
so it's not very discreet. :lol:
the mouse drag solution posted earlier is better way to go.....
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: How to get mouse up events happening outside of mouse ar

Post by tulamide »

billv wrote:The main module, goes True on Mouse down and false on mouse up...
The outer module, just has a false on mouse up, to account for user movement.
Downside is the mouse pointer will be 'activated' when over any part of outer module,
so it's not very discreet. :lol:
the mouse drag solution posted earlier is better way to go.....

Now I understand it. Sorry for being such a slow thinker, it's late at night here in germany. A cool cheat! If someone wants to do it with ruby, it may be the way to detect mouse up messages outside of the current area.
"There lies the dog buried" (German saying translated literally)
Post Reply