wrbuttonevent.java
来自「支持任天堂wii2手柄的java中间件」· Java 代码 · 共 81 行
JAVA
81 行
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: WRButtonEvent.java
package wiiremotej.event;
import wiiremotej.WiiRemote;
import wiiremotej.WiiRemoteJ;
// Referenced classes of package wiiremotej.event:
// WREvent
public class WRButtonEvent extends WREvent
{
public static final int TWO = 1;
public static final int ONE = 2;
public static final int B = 4;
public static final int A = 8;
public static final int MINUS = 16;
public static final int HOME = 128;
public static final int LEFT = 256;
public static final int RIGHT = 512;
public static final int DOWN = 1024;
public static final int UP = 2048;
public static final int PLUS = 4096;
private int buttonsPressed;
private WRButtonEvent lastEvent;
public WRButtonEvent(WiiRemote wiiremote, byte abyte0[], WRButtonEvent wrbuttonevent)
{
super(wiiremote);
buttonsPressed = WiiRemoteJ.bytesToInt(new byte[] {
abyte0[2], abyte0[3]
}) & 0xffff;
lastEvent = wrbuttonevent;
if (wrbuttonevent != null)
wrbuttonevent.lastEvent = null;
}
public WRButtonEvent(WiiRemote wiiremote, int i, WRButtonEvent wrbuttonevent)
{
super(wiiremote);
buttonsPressed = i;
lastEvent = wrbuttonevent;
if (wrbuttonevent != null)
wrbuttonevent.lastEvent = null;
}
public boolean isPressed(int i)
{
return (buttonsPressed & i) == i;
}
public boolean isOnlyPressed(int i)
{
return buttonsPressed == i;
}
public boolean isAnyPressed(int i)
{
return (buttonsPressed & i) != 0;
}
public boolean wasPressed(int i)
{
return !lastEvent.isPressed(i) && isPressed(i);
}
public boolean wasOnlyPressed(int i)
{
return !lastEvent.isPressed(i) && isOnlyPressed(i);
}
public boolean wasReleased(int i)
{
return lastEvent.isPressed(i) && !isPressed(i);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?