📄 mouseevent.java
字号:
/* Ogre4J
Copyright (C) 2002 macross
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.ogre4j.event;
public class MouseEvent extends InputEvent {
protected int buttonId;
protected float mX, mY, mZ;
protected float mRelX, mRelY, mRelZ;
public static final int
BUTTON0_MASK = 1 << 4,
BUTTON1_MASK = 1 << 5,
BUTTON2_MASK = 1 << 6,
BUTTON3_MASK = 1 << 7,
BUTTON_ANY_MASK = 0x1111 << 4;
private void set(
int buttonId,
float mX, float mY, float mZ,
float mRelX, float mRelY, float mRelZ,
int modifiers
) {
this.buttonId = buttonId;
this.mX = mX;
this.mY = mY;
this.mZ = mZ;
this.mRelX = mRelX;
this.mRelY = mRelY;
this.mRelZ = mRelZ;
this.modifiers = modifiers;
}
public float getX() {
return mX;
}
public float getY() {
return mY;
}
public float getZ() {
return mZ;
}
public float getRelX() {
return mRelX;
}
public float getRelY() {
return mRelY;
}
public float getRelZ() {
return mRelZ;
}
public int getButtonId() {
return buttonId;
}
public static boolean isKeyDown(int mask, int buttonMask) {
return (mask & buttonMask) != 0;
}
public String toString() {
return "button="+buttonId+" pos=("+mX+","+mY+","+mZ+") mod="+modifiers;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -