Skip to content

Trigger the mouse event while moving | PoitnerLockControl | Mouse Event #1928

Answered by drcmda
veewoo asked this question in Q&A
Discussion options

You must be logged in to vote

you can fire events imperatively: https://codesandbox.io/s/scrolling-cursor-issue-forked-4mvo7?file=/src/App.js:395-426

const events = useThree((state) => state.events)
...
events.handlers.onPointerMove(e)

pointermove for instance will take care of hover/unhover etc, but it needs an event to go on, you must give it eiter a real or a fake event.

the problem in general is that r3f gives you an event layer, when events happen it reacts. you moving the camera will not trigger anything, no pointer has moved or changed. so you can force it to cast.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@veewoo
Comment options

Answer selected by veewoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants