Processing, keyPressed
用法介绍。
说明
如果按下任何键,布尔系统变量keyPressed
为true
,如果没有按下任何键,则为false
。
请注意,有一个类似名称的函数,称为 keyPressed()
。有关更多信息,请参见其参考页。
例子
// Click on the image to give it focus,
// and then 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 draw() {
if (keyPressed == true) {
fill(0);
} else {
fill(255);
}
rect(25, 25, 50, 50);
}
相关用法
- Processing keyPressed()用法及代码示例
- Processing keyCode用法及代码示例
- Processing key用法及代码示例
- Processing keyReleased()用法及代码示例
- Processing keyTyped()用法及代码示例
- Processing FFT用法及代码示例
- Processing SawOsc.pan()用法及代码示例
- Processing FloatDict用法及代码示例
- Processing FFT.stop()用法及代码示例
- Processing join()用法及代码示例
- Processing () (parentheses)用法及代码示例
- Processing Pulse用法及代码示例
- Processing PShader用法及代码示例
- Processing PVector.set()用法及代码示例
- Processing FloatDict.sortKeysReverse()用法及代码示例
- Processing texture()用法及代码示例
- Processing IntDict.add()用法及代码示例
- Processing PShape.enableStyle()用法及代码示例
- Processing FloatDict.sub()用法及代码示例
- Processing String用法及代码示例
- Processing PImage.pixels[]用法及代码示例
- Processing vertex()用法及代码示例
- Processing PVector.mag()用法及代码示例
- Processing thread()用法及代码示例
- Processing Capture.stop()用法及代码示例
注:本文由纯净天空筛选整理自processing.org大神的英文原创作品 keyPressed。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。