L ludogomez Member Licensed User Longtime User Mar 7, 2018 #1 Hello, I'm using b4j for making a remote video player (I use MQTT between computer). For that, I put a slider and I change the value by MQTT to update the position of the slider. But I want to seek a new time my video with the mouse. I want to use the sub "Value_change", but every time MQTT update the position, the sub "Value_change" is call. I want to call the sub "Value_change" only with the mouse. is it possible ? Thanks a lot. best regards
Hello, I'm using b4j for making a remote video player (I use MQTT between computer). For that, I put a slider and I change the value by MQTT to update the position of the slider. But I want to seek a new time my video with the mouse. I want to use the sub "Value_change", but every time MQTT update the position, the sub "Value_change" is call. I want to call the sub "Value_change" only with the mouse. is it possible ? Thanks a lot. best regards
Daestrum Expert Licensed User Longtime User Mar 7, 2018 #2 If you check the isPressed method on the slider, it will be true if the mouse moved the slider, and false if code changed the slider value. s is the slider in the following code (needs JavaObject library) Code: Copy Sub s_ValueChange (Value As Double) Dim jo As JavaObject = s If jo.RunMethod("isPressed",Null) Then Log(Value) ' mouse moved the slider value Else Return ' code moved the slider value End If End Sub Upvote 0
If you check the isPressed method on the slider, it will be true if the mouse moved the slider, and false if code changed the slider value. s is the slider in the following code (needs JavaObject library) Code: Copy Sub s_ValueChange (Value As Double) Dim jo As JavaObject = s If jo.RunMethod("isPressed",Null) Then Log(Value) ' mouse moved the slider value Else Return ' code moved the slider value End If End Sub
L ludogomez Member Licensed User Longtime User Mar 8, 2018 #3 Hello Daestrum, it works, thanks for the tips. Best regards Upvote 0