p5.js | keyReleased() Function
The keyReleased() function is invoked whenever a key is called every time when a key is pressed. The most recently typed ASCII key is stored into the ‘key’ variable, however, it does not distinguish between uppercase and lowercase characters. The non-ASCII characters can be accessed in the ‘keyCode’ variable with their respective codes.
Different browsers may have their own default behavior attached to some of the keys. This can be prevented by adding “return false” to the end of the function.
Parameters: This method does not accept any parameters.
Below examples illustrate the keyReleased() function in p5.js: