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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。