This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Anton Borzov
Posted Dec 22 - Read on Facebook

Hello Framer community :)
What is the good way to detect mouse cursor position in coordinates of Device viewer?

10 Comments

Miguel Olave

Excellent Jordan Robert Dobson It works perfect!!!!

Jordan Robert Dobson

Yay!

Nils Hoenson

Hey Antoon Borzov, this is fairly easy to do. All you have to do is create a fullscreen layer and then print the coordinates of a TouchMove ‘event’ to get the current coordinates of the cursor. :)

http://share.framerjs.com/0jv3dqvj9vgn/

Anton Borzov

Nils Hoenson yeah, but what if I want to get x values from 0 to 750 in this case? any way to translate screen x values to "device" x values?

Jordan Robert Dobson

See the module I just posted on Thursday or Friday. It helps with exactly this.

Jordan Robert Dobson

Normalize mouse and touch events. Reminds me I need to post this on framercode.

Anton Borzov

Thanks Jordan! Works great for Click, TouchMove events. Throws error on DragMove though.

Jordan Robert Dobson

You probably aren't passing the correct argument objects to the Class methods.

I think Drag event arguments are (event, dragObject, layer) unlike Click/Touch which has arguments (event, layer).

Chris Aga

Thanks for this Jordan Robert Dobson!

Read the entire post on Facebook