Can a set mouse x/y block be made?

Could anybody make a working block something like this:
untitled script pic (19)
untitled script pic (18) ?

Ill see if I can do somthing

AFAIK There is no way of controlling the position of the mouse pointer in a browser application.

No, this can't be done in a browser environment as the security sandbox disallows it. If it were possible malicious actors would be abusing it very frequently. What do you want to do with this anyways?

Yeah its possible

It really isn't

Or to be more correct - there isn't one known to exist in the wild.

If someone DID find a way and published the method, the whole javascript/browser programming world would put all their efforts into negating it :slight_smile:

Make a minecraft where your mouse is set to (0, 0)

from what I understand, there's no way to do it in javascript, but I know it is possible with applications on your computer, which I think is made in C.

Not just C, C++, Rust, Golang, etc. Anyways, he's asking for a way to do it in Snap! , which runs in the browser.

yeah, I know.

window.wcanvas=document.getElementById("world")
window.move=document.onmousemove
window.mControl=true
window.mouse={x:0,y:0}
window.wpos=wcanvas.getBoundingClientRect()
document.onmousemove=function(e){
if(!window.mControl){
e.clientX=mouse.x+wpos.top
e.clientY=mouse.y+wpos.left
}
move(e)
}

The set mouse x/y blocks change mouse.x/mouse.y(but on the entire canvas).
The lock/release mouse pointer blocks change mControl.
Edit:Nope.Doesn't work.Morphic.js doen't rely on mouse moves.

I tried itdidnotwork.com

Theres an option to simulate doing this with pointerlock
And
Mouse move event

Step 1
Dedicate a sprite to work as the cursor
Name the sprite cursor
Run

[quote="shushforshasha, post:14, topic:4369, full:true"]
Theres an option to simulate doing this with pointerlock
And
Mouse move event

Step 1
Dedicate a sprite to work as the cursor
Name the sprite cursor
Run

[scratchblocks]
JsFunc [move_script] [procs] @delInput@addInput
{
document.documentElement.requestPointerLock()
document.addEventListener("mousemove", function(xy){
x = xy.movementX;
y = -(xy.movementY);
procs.evaluate(move_script, new List, true)};
}
with inputs 
[/scratchblocks]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.