p5.js Events Complete ReferenceReadDiscussCoursesPracticeImprove Article ImproveSave Article SaveLike Article LikeThe p5.js events used to provide a dynamic interface to a webpage. These events are hooked to elements in the Document Object Model(DOM).KeyboardDescriptionkeyIsPressedIt is true if any key is pressed and false if no keys are pressed.keyIt always contains the value of the key which is recently pressed.keyCodeIt always contains the key code of the key that is recently pressed.keyPressed()It is invoked whenever a key is pressed.keyReleased()It is invoked whenever a key is called every time when a key is pressed.keyTyped()It is invoked every time when a key is pressed, except for action keys.keyIsDown()It checks the key’s current status that key is down.MouseDescriptionmouseMoved()It is called every time the mouse moves.mouseDragged()It is used to check the mouse drags.mousePressed()It works when mouse clicked on the document.mouseReleased()It works when mouse button released.mouseClicked()It works when mouse button pressed and released.doubleClicked()It is invoked whenever a mouse causes a dblclick event.mouseWheel()It is invoked whenever a mouse causes a vertical mouse wheel event.TouchDescriptiontouchStarted()It is called once after every time a touch is registered.touchEnded()It is called when a touch ends.Last Updated : 18 Aug, 2023Like Article Save Article Please Login to comment...