p5.js Events Complete Reference Improve Improve Improve Like Article Like Save Article Save Share Report issue Report The p5.js events used to provide a dynamic interface to a webpage. These events are hooked to elements in the Document Object Model(DOM). Keyboard Description keyIsPressed It is true if any key is pressed and false if no keys are pressed. key It always contains the value of the key which is recently pressed. keyCode It 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. Mouse Description mouseMoved() 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. Touch Description touchStarted() It is called once after every time a touch is registered. touchEnded() It is called when a touch ends. Last Updated : 18 Aug, 2023 Like Article Save Article Previous p5.js Touch touchEnded() Next p5.Image save() Method Share your thoughts in the comments Add Your Comment Please Login to comment...