Get mouse move event?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Get mouse move event?

Post by MRx »

Hi,

does anyone have some sample code for getting a mouse move event?
I'd like to trigger some functions that will display additional information like 1/2 seconds after an item got selected and the mouse is not moving. It should be hidden when the mouse is moving again.

I've seen some coin events but not sure if they're suitable and which ones are suitable for that at the moment.
https://coin3d.github.io/Coin/html/clas ... Event.html
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Get mouse move event?

Post by openBrain »

Do you want to address 3D View, Tree,...?
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Get mouse move event?

Post by MRx »

Hi,

sorry that I didn't reply earlier - I was digging into other things.

following is what I was looking for:

Code: Select all

def logPosition(event):
   print(event)
   print(dir(event))


v=Gui.activeDocument().activeView()
c=v.addEventCallback("SoEvent",logPosition)
Post Reply