Skip to content

Commit

Permalink
Merge branch 'fix/inline-docs-ev-handlers' into fix/inline-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fal-works committed Jan 10, 2021
2 parents 82639b0 + 45c759d commit de6fbdc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/core/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,14 @@ p5.prototype.windowHeight = getWindowHeight();
/**
* The <a href="#/p5/windowResized">windowResized()</a> function is called once
* every time the browser window is resized. This is a good place to resize the
* canvas or do any other adjustments to accommodate the new window size.
* canvas or do any other adjustments to accommodate the new window size.<br><br>
* Browsers may have different default behaviors attached to various UI
* events. To prevent any default behavior for this event, add "return false"
* to the end of the method.
*
* @method windowResized
* @param {Object} [event] optional UIEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div class="norender"><code>
* function setup() {
Expand Down
6 changes: 6 additions & 0 deletions src/events/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ p5.prototype.keyCode = 0;
* behavior for this event, add "return false" to the end of the method.
*
* @method keyPressed
* @param {Object} [event] optional KeyboardEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -194,6 +196,8 @@ p5.prototype._onkeydown = function(e) {
* behavior for this event, add "return false" to the end of the method.
*
* @method keyReleased
* @param {Object} [event] optional KeyboardEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -253,6 +257,8 @@ p5.prototype._onkeyup = function(e) {
* to the end of the method.
*
* @method keyTyped
* @param {Object} [event] optional KeyboardEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down
8 changes: 7 additions & 1 deletion src/events/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ p5.prototype._setMouseButton = function(e) {
*
* @method mouseMoved
* @param {Object} [event] optional MouseEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -542,6 +543,7 @@ p5.prototype._setMouseButton = function(e) {
*
* @method mouseDragged
* @param {Object} [event] optional MouseEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -624,6 +626,7 @@ p5.prototype._onmousemove = function(e) {
*
* @method mousePressed
* @param {Object} [event] optional MouseEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -703,6 +706,7 @@ p5.prototype._onmousedown = function(e) {
*
* @method mouseReleased
* @param {Object} [event] optional MouseEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -781,6 +785,7 @@ p5.prototype._ondragover = p5.prototype._onmousemove;
*
* @method mouseClicked
* @param {Object} [event] optional MouseEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -849,6 +854,7 @@ p5.prototype._onclick = function(e) {
*
* @method doubleClicked
* @param {Object} [event] optional MouseEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -939,7 +945,7 @@ p5.prototype._pmouseWheelDeltaY = 0;
*
* @method mouseWheel
* @param {Object} [event] optional WheelEvent callback argument.
*
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down
3 changes: 3 additions & 0 deletions src/events/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function getTouchInfo(canvas, w, h, e, i = 0) {
*
* @method touchStarted
* @param {Object} [event] optional TouchEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -158,6 +159,7 @@ p5.prototype._ontouchstart = function(e) {
*
* @method touchMoved
* @param {Object} [event] optional TouchEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down Expand Up @@ -230,6 +232,7 @@ p5.prototype._ontouchmove = function(e) {
*
* @method touchEnded
* @param {Object} [event] optional TouchEvent callback argument.
* @return {*} false if any default behavior should be prevented for this event. (Optional)
* @example
* <div>
* <code>
Expand Down

0 comments on commit de6fbdc

Please sign in to comment.