Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.03 KB

README.md

File metadata and controls

30 lines (19 loc) · 1.03 KB

processing.input

A simple p5.js and Processing add-on to let you use input. Just simply add to your code!

Variables added

  • keysHeld is a array (an ArrayList in Processing) with all the keys pressed stored in it.
  • aKeyPressed is detecting when a key is pressed (just a merge of keyPressed in processing and keyIsPressed in p5.js basically so your projects are easier to convert to p5.js/processing)
  • theKey is the last key pressed.
  • keysLog is a string containing all keys ever pressed.

Add it

p5.js

Download the p5.input.js file and add

<script src="p5.input.js"></script>

to your code.

Processing (as of version 4)

Copy and paste the processing.input.pde file to your code.

Demo

There is a demonstration of p5.input.js and how it works here, as well as a demonstration using a emulated Java/Processing Environment here. It is also shown on the p5js libraries site.