Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 10th, 2025, 9:21 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: GetMousePosition() script
PostPosted: April 23rd, 2006, 3:56 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi

I'm trying to set it up so that the viewer can see a display of the X and Y coordinates of their mouse on the page that is continuously updated as the mouse is moved by them.

Using the scripting help guide, I set up variables for mousePos, mouseX and mouseY and the following script:

var mousePos = GetMousePosition()
var mouseX = mousePos.x
var mouseY = mousePos.y

I then placed a text box with the variables mouseX and mouseY inserted for the display. On the page itself, I set up a mouse move action with the above script.

The result is a one-time only display of the the mouse's X and Y coordinates which happens on show (it occurs on show and doesn't even seem to require the mouse to be moved). It doesn't update or change.

I've experimented by replacing the mouse move trigger with a ticker trigger (0.10 intervals) or a timeline (0.05 intervals) with continuous repeat to try to get the display to continuously update the mouse's coordinates, but with no success. I've even tried storing and reading the variables from the registry with no better result.

I must be doing something wrong. In theory, it seems like it should work.

I would appreciate any help.

Kind Regards,
Stephen


Top
 Profile  
 
 Post subject: Re: GetMousePosition() script
PostPosted: April 23rd, 2006, 5:10 pm 
Offline

Joined: November 5th, 2004, 6:54 am
Posts: 130
Location: Hengelo, The Netherlands
Opus: 8.5/9.0
OS: Windows 7 64-bits, Android 2.1, Android 4.1.2, iOS 7
System: Pentium 7i, 6GB RAM, 750GB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses
Hi Stephen,

Look at my example.
Hope this helps.

Kind regards,


You do not have the required permissions to view the files attached to this post.

_________________
Oscar Nijst
ON Education & Consultancy
Hengelo, The Netherlands
OPUS Pro 9.5
Pentium 7i, 16GB RAM, 1 TB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 23rd, 2006, 6:01 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks Oscar for this assistance.

I think what made the difference was creating the variables mouseX and mouseY as page instead of publication variables.

In any event, I've now got it working properly.

Thanks!

Kind Regards,
Stephen


Top
 Profile  
 
 Post subject:
PostPosted: April 23rd, 2006, 6:50 pm 
Offline

Joined: November 5th, 2004, 6:54 am
Posts: 130
Location: Hengelo, The Netherlands
Opus: 8.5/9.0
OS: Windows 7 64-bits, Android 2.1, Android 4.1.2, iOS 7
System: Pentium 7i, 6GB RAM, 750GB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses
Hi Stephen,

I have checked this.
Both works.
You may also declare the variables in the publication properties.

But you defined the variables in the script using

var mouseX

and then the application doesn't recognize the variables.

I only used mouseX because I first declared them into the variables of the application.

Kind regards,

_________________
Oscar Nijst
ON Education & Consultancy
Hengelo, The Netherlands
OPUS Pro 9.5
Pentium 7i, 16GB RAM, 1 TB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 23rd, 2006, 7:03 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks Oscar for your reply.

My dilemma is that I was trying to allow the viewer to see where one of 14 drag and drop dots (vectors) had been placed. The problem is that, since drag and drop requires them to use a left mouse down trigger to drag the dot, the X and Y positions of the mouse are static while dragging. So, the viewer doesn't get an easy way to read where they've moved the dot, unless they release it and then re-place the mouse over the dropped dot to read the new, updated X and Y coordinates.

I'm trying to figure out a more viewer-friendly means to accomplish this, more smoothly.

Any ideas are appreciated.

Kind Regards,
stephen


Top
 Profile  
 
 Post subject:
PostPosted: April 23rd, 2006, 8:04 pm 
Offline

Joined: November 5th, 2004, 6:54 am
Posts: 130
Location: Hengelo, The Netherlands
Opus: 8.5/9.0
OS: Windows 7 64-bits, Android 2.1, Android 4.1.2, iOS 7
System: Pentium 7i, 6GB RAM, 750GB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses
Hi Stephen,

I used the ticker to change the mousX and mousY each 0.01 second.
See my attachment.

Kind Regards,


You do not have the required permissions to view the files attached to this post.

_________________
Oscar Nijst
ON Education & Consultancy
Hengelo, The Netherlands
OPUS Pro 9.5
Pentium 7i, 16GB RAM, 1 TB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 78 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group