Notifications
Clear all

[Closed] mouseTrack() function Any one use it?

 PEN

For the life of me I can’t get this one working. I’m trying to get the call back setup and I can’t find the syntax that works. The help needs some help I think.

13 Replies

I’ve used it in a couple of scripts… What sort of trouble are you having?

 PEN

Do you have any example code on how to use the call back function? I just can’t get the syntax right. It isn’t doing a thing.

Hey Paul,

I haven’t used the mouseTrack() function specifically but I did use mouse tracking in this script…it might be helpful to look at

 PEN

Thanks. I have used all the other mouse tracking tools before just never mouseTrack().

I think this way works, although #mouseAbout doesn’t seem to work… (press ESC to exit tracking)


  fn MyCallbackFn msg ir obj faceNum shift ctrl alt =
  (    
      myStr = "Pos ("+mouse.pos.x as string +", "+ mouse.pos.y as string + ")"
      
      case msg of
      (
          #freeMove: myStr += " [freeMove]"
          #mousePoint: myStr += " [left click]"
          #mouseMove: myStr += " [left drag]"
          #mouseabout: myStr += " [righ click]"
      )
      
      print myStr
      #continue 
  )
  
  mouseTrack trackCallback:MyCallbackFn 
  

hope this helps

/Lui

cyberluigi2k’s code is right except that it’s #mouseAbort instead of #mouseAbout.
You can also get it to track on a specific object using the ’ on:<node> ’ option in the call.

1 Reply
(@cyberluigi2k)
Joined: 11 months ago

Posts: 0

LOL!! it seems so obvious… i was thinking why on earth they choose mouseabout for the right button… anyway in my deffense i can say that i took it from the documentation… you can read at “[color=white]mouseTrack() Function[/color]” topic

[left]The ‘msg’ argument is a message code that indicates what kind of action occurred, and can be one of:
[/left]
[left]#freeMove – means the mouse is moved without a button being pressed
[/left]
[left]#mousePoint – means the left mouse button has just been pressed
[/left]
[left]#mouseMove – means the mouse is being dragged with the left button down
[/left]
[left]#mouseAbout[size=3]- means the right mouse button was clicked, normally meaning cancel[/size]
[/left]

I’ve used the mousetrack function before but if I remember correctly it doesn’t allow any viewport operations (panning/zooming). That’s why I prefer mouse tools.

Cheers,
Martijn

 PEN

Mouse tools doesn’t allow of it either that is why I’m looking at other methods

Oops!! Sorry Paul… I thought I was replying to your message but I accidentally pressed the Edit button instead and removed most part of your post…

Martijn

You can rotate and pan/zoom with mousetrack via the middle mouse button. Just not with the viewport control buttons (which change the focus of the cursor).

Page 1 / 2