Group Abstract Group Abstract

Message Boards Message Boards

3
|
9.9K Views
|
4 Replies
|
9 Total Likes
View groups...
Share
Share this post:

How to get MousePosition[] in the cloud? By JavaScriptExecute ?

Posted 11 years ago

Since MousePosition[] returns $Failed in WolframCloud I was wondering if I could use CloudSystem`JavaScriptExecute to emulate MousePosition[].

But how does JavaScriptExecute actually work?

Suppose I want to first add a javascript function, like

function mouse_position()
{
    var e = window.event;

    var posX = e.clientX;
    var posY = e.clientY;

    document.Form1.posx.value = posX;
    document.Form1.posy.value = posY;

    var t = setTimeout("mouse_position()",100);

}

and then execute it. How to do it? Or did I overlook any documentation of JavaScriptExecute?

POSTED BY: Rolf Mertig
4 Replies

Rolf, our teams are considering this and related features for the future. Thanks for letting us know this is something of interest.

POSTED BY: Vitaliy Kaurov

But how do I interact with Mathematica? I.e., how do I get the same information into the Kernel like MousePosition[] ?

POSTED BY: Rolf Mertig
POSTED BY: Sam Carrettie
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard