Simple Mouselock Plugin:
Download | Simple Mouselock Example: Download
This plugin makes it possible to make use of native-like pointer locking in your projects and games.
Compared to the existing but depreciated plugin, this plugin is much more simplified and easier to use.
The majority of features from the depeciated plugin have been imported, enhanced and optimized.
Simple mouselocking with several bounding options
Properties and events to modify the pointer or fetch other useful information
New properties to auto-enable or activate mouselocking without any events
Generally simplified & optimized the plugin to improve usability
Makes it possible to move the mouse pointer infinitly¹. Great for 2D shooters and RTS games!
Prevents the mouse pointer from going off-canvas, when the game is embedded on a website or in fullscreen².
Allows the use of a sprite as the mouse pointer, enabling some advanced features (e.g. animated cursors).
The API uses a type of "software cursor", minor input lag³ can be expected.
Might require the user to give permissions first.
IE and older browsers might not support4 this feature.
¹ If bounding property is set to "unbounded". ² Usually only affects users with multiple screens. ³ Input lag testing on the web. 4 Chrome status website for support information.
- Thanks to Armaldio, who updated and made this plugin possible (Donations ? Website)
- Pointer Lock API MDN Web docs (?)
- Video introducing the pointer lock API (?)
- Pointer lock api demo project (?)
- Depreciated Mouselocking plugin (?)
- Icon created by Freepik (?)