Processing, keyTyped()
用法介紹。
用法
keyTyped()
keyTyped(event)
返回
void
說明
每次按下某個鍵時都會調用一次keyTyped()
函數,但會忽略 Ctrl、Shift 和 Alt 等操作鍵。
由於操作係統如何處理鍵重複,按住一個鍵可能會導致多次調用 keyTyped()
。重複率由操作係統設置,並且可以在每台計算機上進行不同的配置。
鼠標和鍵盤事件僅在程序具有 draw()
時起作用。如果沒有 draw()
,代碼隻運行一次,然後停止監聽事件。
例子
// Run this program to learn how each of these functions
// relate to the others.
void draw() { } // Empty draw() needed to keep the program running
void keyPressed() {
println("pressed " + int(key) + " " + keyCode);
}
void keyTyped() {
println("typed " + int(key) + " " + keyCode);
}
void keyReleased() {
println("released " + int(key) + " " + keyCode);
}
相關用法
- Processing keyCode用法及代碼示例
- Processing keyPressed用法及代碼示例
- Processing keyPressed()用法及代碼示例
- Processing key用法及代碼示例
- Processing keyReleased()用法及代碼示例
- 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大神的英文原創作品 keyTyped()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。