@@ -145,6 +145,9 @@ define(function (require) {
145145 /**
146146 * The mouseMoved() function is called every time the mouse moves and a mouse
147147 * button is not pressed.
148+ * Browsers may have different default
149+ * behaviors attached to various mouse events. To prevent any default
150+ * behavior for this event, add `return false` to the end of the method.
148151 *
149152 * @method mouseMoved
150153 * @example
@@ -166,12 +169,25 @@ define(function (require) {
166169 * }
167170 * </code>
168171 * </div>
172+ *
173+ * <div class="norender">
174+ * <code>
175+ * function mouseMoved() {
176+ * ellipse(mouseX, mouseY, 5, 5);
177+ * // prevent default
178+ * return false;
179+ * }
180+ * </code>
181+ * </div>
169182 */
170183
171184 /**
172185 * The mouseDragged() function is called once every time the mouse moves and
173186 * a mouse button is pressed. If no mouseDragged() function is defined, the
174187 * touchMoved() function will be called instead if it is defined.
188+ * Browsers may have different default
189+ * behaviors attached to various mouse events. To prevent any default
190+ * behavior for this event, add `return false` to the end of the method.
175191 *
176192 * @method mouseDragged
177193 * @example
@@ -193,6 +209,16 @@ define(function (require) {
193209 * }
194210 * </code>
195211 * </div>
212+ *
213+ * <div class="norender">
214+ * <code>
215+ * function mouseDragged() {
216+ * ellipse(mouseX, mouseY, 5, 5);
217+ * // prevent default
218+ * return false;
219+ * }
220+ * </code>
221+ * </div>
196222 */
197223 p5 . prototype . onmousemove = function ( e ) {
198224 var context = this . _isGlobal ? window : this ;
@@ -228,14 +254,16 @@ define(function (require) {
228254 * can be used to determine which button has been pressed. If no
229255 * mousePressed() function is defined, the touchStarted() function will be
230256 * called instead if it is defined.
257+ * Browsers may have different default
258+ * behaviors attached to various mouse events. To prevent any default
259+ * behavior for this event, add `return false` to the end of the method.
231260 *
232261 * @method mousePressed
233262 * @example
234263 * <div>
235264 * <code>
236265 * // Click within the image to change
237266 * // the value of the rectangle
238- * // after the mouse has been clicked
239267 *
240268 * var value = 0;
241269 * function draw() {
@@ -251,6 +279,16 @@ define(function (require) {
251279 * }
252280 * </code>
253281 * </div>
282+ *
283+ * <div class="norender">
284+ * <code>
285+ * function mousePressed() {
286+ * ellipse(mouseX, mouseY, 5, 5);
287+ * // prevent default
288+ * return false;
289+ * }
290+ * </code>
291+ * </div>
254292 */
255293 p5 . prototype . onmousedown = function ( e ) {
256294 var context = this . _isGlobal ? window : this ;
@@ -276,6 +314,10 @@ define(function (require) {
276314 * The mouseReleased() function is called every time a mouse button is
277315 * released. If no mouseReleased() function is defined, the touchEnded()
278316 * function will be called instead if it is defined.
317+ * Browsers may have different default
318+ * behaviors attached to various mouse events. To prevent any default
319+ * behavior for this event, add `return false` to the end of the method.
320+ *
279321 *
280322 * @method mouseReleased
281323 * @example
@@ -299,6 +341,16 @@ define(function (require) {
299341 * }
300342 * </code>
301343 * </div>
344+ *
345+ * <div class="norender">
346+ * <code>
347+ * function mouseReleased() {
348+ * ellipse(mouseX, mouseY, 5, 5);
349+ * // prevent default
350+ * return false;
351+ * }
352+ * </code>
353+ * </div>
302354 */
303355 p5 . prototype . onmouseup = function ( e ) {
304356 var context = this . _isGlobal ? window : this ;
@@ -322,6 +374,9 @@ define(function (require) {
322374 /**
323375 * The mouseClicked() function is called once after a mouse button has been
324376 * pressed and then released.
377+ * Browsers may have different default
378+ * behaviors attached to various mouse events. To prevent any default
379+ * behavior for this event, add `return false` to the end of the method.
325380 *
326381 * @method mouseClicked
327382 * @example
@@ -345,6 +400,16 @@ define(function (require) {
345400 * }
346401 * </code>
347402 * </div>
403+ *
404+ * <div class="norender">
405+ * <code>
406+ * function mouseClicked() {
407+ * ellipse(mouseX, mouseY, 5, 5);
408+ * // prevent default
409+ * return false;
410+ * }
411+ * </code>
412+ * </div>
348413 */
349414 p5 . prototype . onclick = function ( e ) {
350415 var context = this . _isGlobal ? window : this ;
@@ -361,6 +426,9 @@ define(function (require) {
361426 * the mouse wheel if rotated up or away from the user and positive in the
362427 * other direction. On OS X with "natural" scrolling enabled, the values are
363428 * opposite.
429+ * Browsers may have different default
430+ * behaviors attached to various mouse events. To prevent any default
431+ * behavior for this event, add `return false` to the end of the method.
364432 *
365433 * See <a href="http://www.javascriptkit.com/javatutors/onmousewheel.shtml">
366434 * mouse wheel event in JS</a>.
0 commit comments