首页 > 文档 > mouseWheel()鼠标滚轮函数
2017
07-14

mouseWheel()鼠标滚轮函数

1-8.mouseWheel()

Name(名称):mouseWheel()//鼠标滚轮函数

Examples(例子):

void setup() {

size(100, 100);

}

void draw() {}

void mouseWheel(MouseEvent event) {

float e = event.getCount();

println(e);

}

Description(描述):The mouseWheel() function returns positive values when the mouse wheel is rotated down (toward the user), and negative values for the other direction (up or away from the user). On OS X with “natural” scrolling enabled, the values are opposite.

mouseWheel()函数在鼠标滚轮(向用户)旋转时返回正的值,而另一个方向的负值值(向上或离开用户)。在启用”自然”滚动的OS X上,值是相反的。

Mouse and keyboard events only work when a program has draw(). Without draw(), the code is only run once and then stops listening for events.

鼠标和键盘事件只在程序绘制()时才起作用。没有绘制(),代码只运行一次,然后停止监听事件。

Syntax(语法):mouseWheel(event)

Parameters (参数):event——the MouseEvent鼠标事件

Returns(返回值):Void(

Related(相关函数):mouseX
mouseY
pmouseX
pmouseY
mousePressed
mousePressed()
mouseReleased()
mouseClicked()
mouseMoved()
mouseButton



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。