Cursor Position

BradCarstenBradCarsten Posts: 856

Edit* I see that this is only for 4.11 and above, so is there another way to get the cursor. 

 

In the Point reference page, there is an example for returning the cursors global position: 

var pntCursor = (new Point).cursorPos();

 

When I run this however I get the following error: 

Script Error: Line 17

TypeError: Result of expression '(new Point).cursorPos' [undefined] is not a function.
Stack Trace: ()@:17

Any Ideas? 

I'm running DS 4.10 32bit

 

Post edited by BradCarsten on

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,876

    This was added precisely because there wasn't a way to get mouse information before, so I'm afraid you will just have to wait until we get a new release version (or at least a new Public Beta).

  • BradCarstenBradCarsten Posts: 856

    Thanks Richard. This is going to be such a useful feature. 

  • YudinEdYudinEd Posts: 90
    edited March 2018

    Try DzListView. You can get the cursor .

    var Dlg = new DzDialog();var LV = new DzListView( Dlg );LV.minWidth = 500;LV.minHeight = 500;connect(LV,"mouseButtonPressed(int,DzListViewItem*,const QPoint&,int)" , mouseClicked );Dlg.exec()function mouseClicked (button, item, pos, col){		if( button == 1) print("left button")				if( button == 2) print("right button")		if (button==4) print ("mid button")        print ("y-"+ pos.y,"x-"+ pos.x)//  where is cursor? }

    Other actions :

    "doubleClicked(DzListViewItem*,const QPoint&,int)" 

    "rightButtonClicked(DzListViewItem*,const QPoint&,int)"

    Post edited by YudinEd on
  • TotteTotte Posts: 13,965
    bradrg said:

    Thanks Richard. This is going to be such a useful feature. 

    That's why asked for it to be added ;)

Sign In or Register to comment.