preliminary implementation of wheel events (issue #1423)

This commit is contained in:
benfry
2013-01-19 20:18:09 +00:00
parent 1af0c3fea4
commit f5ccad12b3
5 changed files with 108 additions and 21 deletions

View File

@@ -33,10 +33,12 @@ public class MouseEvent extends Event {
static public final int MOVE = 5;
static public final int ENTER = 6;
static public final int EXIT = 7;
static public final int WHEEL = 8;
protected int x, y;
protected int button;
protected int clickCount;
// protected int clickCount;
protected float amount;
// public MouseEvent(int x, int y) {
@@ -48,13 +50,14 @@ public class MouseEvent extends Event {
public MouseEvent(Object nativeObject,
long millis, int action, int modifiers,
int x, int y, int button, int clickCount) {
int x, int y, int button, float amount) { //int clickCount) {
super(nativeObject, millis, action, modifiers);
this.flavor = MOUSE;
this.x = x;
this.y = y;
this.button = button;
this.clickCount = clickCount;
//this.clickCount = clickCount;
this.amount = amount;
}
@@ -79,8 +82,18 @@ public class MouseEvent extends Event {
// }
@Deprecated
public int getClickCount() {
return clickCount;
return (int) amount; //clickCount;
}
/**
* Number of clicks for mouse button events, or the number of steps (positive
* or negative depending on direction) for a mouse wheel event.
*/
public float getAmount() {
return amount;
}