Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/events/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,10 @@ p5.prototype._onwheel = function(e) {
* Note that not all browsers support this feature.
* This enables you to create experiences that aren't limited by the mouse moving out of the screen
* even if it is repeatedly moved into one direction.
* For example, a first person perspective experience.
* For example, a first person perspective experience. It is recommended to
* use <a href="#/p5/requestPointerLock">requestPointerLock()</a> as a result
* of any user interaction, like <a href="#/p5/mouseClicked">mouseClicked()</a>
* or <a href="#/p5/keyPressed">keyPressed()</a>
*
* @method requestPointerLock
* @example
Expand All @@ -993,7 +996,6 @@ p5.prototype._onwheel = function(e) {
* let cam;
* function setup() {
* createCanvas(100, 100, WEBGL);
* requestPointerLock();
* cam = createCamera();
* }
*
Expand All @@ -1003,6 +1005,10 @@ p5.prototype._onwheel = function(e) {
* cam.tilt(movedY * 0.001);
* sphere(25);
* }
*
* function mouseClicked() {
* requestPointerLock();
* }
* </code>
* </div>
*
Expand All @@ -1024,8 +1030,8 @@ p5.prototype.requestPointerLock = function() {

/**
* The function <a href="#/p5/exitPointerLock">exitPointerLock()</a>
* exits a previously triggered <a href="#/p5/requestPointerLock">pointer Lock</a>
* for example to make ui elements usable etc
* exits a previously triggered <a href="#/p5/requestPointerLock">pointer Lock</a>.
* For example, it might be used to make UI elements usable once again.
*
* @method exitPointerLock
* @example
Expand Down