Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 773
Naeem Shaikh Avatar asked Mar 14 '26 21:03

Naeem Shaikh


1 Answers

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)

like image 96
Katana314 Avatar answered Mar 17 '26 09:03

Katana314



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!