mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Initial mobile website check in
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<root>
|
||||
<name>keyPressed()</name>
|
||||
|
||||
<category>Input/Output</category>
|
||||
|
||||
<subcategory>Keyboard</subcategory>
|
||||
|
||||
<usage>Web & Application</usage>
|
||||
|
||||
<example>
|
||||
<image>keyPressed_.jar</image>
|
||||
<code>
|
||||
// Click on the image to give it focus,
|
||||
// and then press any key
|
||||
|
||||
int value = 0;
|
||||
|
||||
void loop() {
|
||||
fill(value);
|
||||
rect(25, 25, 50, 50);
|
||||
}
|
||||
|
||||
void keyPressed()
|
||||
{
|
||||
if(value == 0) {
|
||||
value = 255;
|
||||
} else {
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
</code>
|
||||
</example>
|
||||
|
||||
<description>
|
||||
The <b>keyPressed()</b> function is called once every time a key is pressed. As a general rule, nothing should be draw within the <b>keyPressed()</b> block.
|
||||
</description>
|
||||
|
||||
<syntax>
|
||||
void keyPressed() {
|
||||
<c>statements</c>
|
||||
}
|
||||
</syntax>
|
||||
|
||||
<parameter>
|
||||
<label></label>
|
||||
<description></description>
|
||||
</parameter>
|
||||
|
||||
<returns>None</returns>
|
||||
|
||||
<related>
|
||||
keyPressed
|
||||
key
|
||||
keyCode
|
||||
keyReleased()
|
||||
</related>
|
||||
|
||||
<availability>1.0</availability>
|
||||
|
||||
<type>Function</type>
|
||||
|
||||
<partof>Core</partof>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</root>
|
||||
Reference in New Issue
Block a user