Files
processing4/mobile/web/reference/API/keyPressed_var.xml
2005-01-27 06:48:42 +00:00

69 lines
1.0 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>keyPressed</name>
<category>Input/Output</category>
<subcategory>Keyboard</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>keyPressed.jar</image>
<code>
// Click on the image to give it focus
// and press any key
// Note: the rectangle in this example may
// flicker as the operating system may
// register a long key press as a repetition
// of key presses
void loop() {
if (keyPressed == true) {
fill(0);
} else {
fill(255);
}
rect(25, 25, 50, 50);
}
</code>
</example>
<description>
The boolean system variable <b>keyPressed</b> is <b>true</b> if any key is pressed and <b>false</b> if no keys are pressed.
</description>
<syntax>
keyPressed
</syntax>
<parameter>
<label></label>
<description></description>
</parameter>
<returns></returns>
<related>
key
keyCode
keyPressed()
keyReleased()
</related>
<availability>1.0</availability>
<type>System variable</type>
<partof>Core</partof>
</root>