Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
p5js-interaction [2024/02/21 23:58] – renick | p5js-interaction [2024/02/22 00:31] – renick | ||
---|---|---|---|
Line 16: | Line 16: | ||
p5js also has some functions that deal with mouse position relative to the previous frame, including detecting mouse movement, mouse dragging, and whether the left button is pressed. There' | p5js also has some functions that deal with mouse position relative to the previous frame, including detecting mouse movement, mouse dragging, and whether the left button is pressed. There' | ||
- | ====== tracking the mouse ====== | + | ===== tracking the mouse ===== |
In the following example, we make a box follow the mouse. | In the following example, we make a box follow the mouse. | ||
Line 114: | Line 114: | ||
Read more about the keyIsDown function here: https:// | Read more about the keyIsDown function here: https:// | ||
+ | |||
+ | ===== more about mouse and keyboard in p5js ===== | ||
+ | |||
+ | For more on mouse and keyboard interaction in p5js, see the ' | ||
===== using mouse and keyboard events outside of p5js ===== | ===== using mouse and keyboard events outside of p5js ===== | ||
+ | All of these are done with the functions provided by p5js. There is a whole set of keyboard and mouse event handlers built into your browser. You can find more information on them here: | ||
+ | |||
+ | keyboard events: https:// | ||
+ | mouse events: https:// |