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

What is Framer? Join the Community
Return to index
Isa Bison
Posted Jul 05 - Read on Facebook

Is there a -solid- way of getting the cursor location on mouse move anywhere?

My original approach was: Framer.Device.screen.onMouseMove (e,layer)-> GlobalMouseX = e.offsetX # use GlobalMouseX later, etc.

But the mouseMove event is captured by child layers. Moreover the layer parameter does not correctly point to these layers when they capture the event.

e.pageX is not an option because it gets messed up when things are scaled.

1 Comments

Isa Bison

The answer is MouseEvent.contextPoint, a property that Framer now adds to all MouseEvents. (See 'Event Coordinates' here: https://github.com/koenbok/Framer/wiki/DPR-Upgrade-Guide )

Read the entire post on Facebook