mouseMoveCaptured with right mouse button - bug?

For general discussion related FlowStone
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

mouseMoveCaptured with right mouse button - bug?

Post by Nubeat7 »

hi all,

i found out that you can start captureMouse with the right mousebutton but you cannot finish the the capturing without ending in a locked mouse state for the view you were using it it stays in an active capureing mode

as an easy example just take one of the stock knobs and change the mouseLDown to mouseRDown and try to finish the capturing, i was assuming that you finish it with mouseRUpCaptured but it looks like this methode isn't existing or it doesn't work, and with the mouseRUp methode the capture isn't stopping...

and if you use the leftclick then it hangs and no mouse action is possible any more

so is this a bug? or how can i finish capturingMouse when activated with mouseRDown?
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: mouseMoveCaptured with right mouse button - bug?

Post by tulamide »

Hmm, I'm not sure what is happening. Try my demo, it works for me (right click, drag, release).
Attachments
rightmousebutton.fsm
(538 Bytes) Downloaded 1033 times
"There lies the dog buried" (German saying translated literally)
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: mouseMoveCaptured with right mouse button - bug?

Post by Nubeat7 »

hmm yes thats interesting, now try the rightmousebutton knob, the only thing i changed is the L to a R and mouseRUp instead of mouseRUpCapture..
Attachments
rightmouseknob.fsm
(7.04 KiB) Downloaded 1073 times
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: mouseMoveCaptured with right mouse button - bug?

Post by Nubeat7 »

but whats interesting is that it works inside the isInMousePoint defined area!
tulamide
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: mouseMoveCaptured with right mouse button - bug?

Post by tulamide »

But that's not interesting, that's logical! isInMousePoint returns either true or false, and only if it is true all following methods get mouse events. And in this case, true is only sent when the mouse is in a specified area ;)
"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: mouseMoveCaptured with right mouse button - bug?

Post by KG_is_back »

tulamide wrote:But that's not interesting, that's logical! isInMousePoint returns either true or false, and only if it is true all following methods get mouse events. And in this case, true is only sent when the mouse is in a specified area ;)

Yeah, it is annoying but expected that mouse events do not work outside the area. There might be a fix to that - while the mouse button is held expand the isInMousePoint area to be always true. It will probably fail though, because mouse point area is always clipped to the module GUI.
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: mouseMoveCaptured with right mouse button - bug?

Post by Nubeat7 »

KG_is_back wrote:Yeah, it is annoying but expected that mouse events do not work outside the area. There might be a fix to that - while the mouse button is held expand the isInMousePoint area to be always true. It will probably fail though, because mouse point area is always clipped to the module GUI.


yes sadly thats no alternative,

whereas mouseLUpCaptured works also does its job outside the area!
i'm also wondering about the mouseLUpCaptured methode if it is defined by FS because it is not documented in the userguide and what is releaseMouse for? shouldn't releaseMouse finish capturing independent from what mousebutton is released?

i need it for the cablepatcher to connect sources with targets which works fine when you release it on an active area (target) but nothing should happen when you are outside an area.. works normal with left mousebuttons but not with right
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: mouseMoveCaptured with right mouse button - bug?

Post by KG_is_back »

I have an idea. maybe you could use empty full-View module for interaction
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: mouseMoveCaptured with right mouse button - bug?

Post by Tronic »

I do not know how expensive it can be, but it works well,
put this workaround in the "draw" method, get the value from "mouseMoveCaptured" method.

Code: Select all

(isKeyPressed(1) or isKeyPressed(2))  ?  captureMouse(0) : releaseMouse(0) 
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: mouseMoveCaptured with right mouse button - bug?

Post by billv »

Nubeat7 wrote:i found out that you can start captureMouse with the right mousebutton but you cannot finish the the capturing without ending in a locked mouse state for the view you were using it it stays in an active capureing mode

Nubeat7 wrote:and with the mouseRUp methode the capture isn't stopping...


locking the "active capturing" in a variable...seems to work great...

Code: Select all

def mouseLDown x,y
   @mouse=0
    captureMouse if @mouse = 0   
end
def mouseRDown x,y
   @mouse=1
    captureMouse if @mouse = 1   
end
def mouseMoveCaptured x,y 
       if @mouse==0 then
          output 0,x
   elsif @mouse==1 then
          output 1,y
      end
end
def mouseLUp x,y
     releaseMouse if @mouse = 0
end
def mouseRUp x,y
     releaseMouse if @mouse = 1
end
Post Reply