Naeem Shaikh
Naeem Shaikh

Reputation: 15715

Reduce Mouse Speed

I am trying to create a simple application using canvas but I require to lower down the speed of mouse-move when I take the mouse over the canvas. I tried finding the solution on internet but couldn't.

I just wanted to know if it is possible can anyone help please.

Upvotes: 3

Views: 3092

Answers (1)

Katana314
Katana314

Reputation: 8620

Given that you're working with a canvas, you're likely making a game - and I'd say this might be more possible than you think. You probably won't be able to use the actual mouse pointer itself - probably not an issue if you have some mouse graphic available - but could have a "virtual" mouse using this, taking MouseMove events and multiplying them by some fraction. Unfortunately, I think you'd have to do a lot of the research yourself!

https://developer.mozilla.org/en-US/docs/WebAPI/Pointer_Lock

This API is used for things like the Quake WebGL demos.

(To those worried about security: Don't worry, the API has the browser request permission from the user using a dropdown)

Upvotes: 3

Related Questions