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()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。