mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 08:05:34 -04:00
Gamebutton is more flexible now
This commit is contained in:
parent
ddb2307a3d
commit
3c1bb45f57
@ -11,12 +11,15 @@ public class GamepadButton {
|
|||||||
private boolean isDown = false;
|
private boolean isDown = false;
|
||||||
|
|
||||||
public void update(KeyEvent event){
|
public void update(KeyEvent event){
|
||||||
boolean down = (event.getAction() == KeyEvent.ACTION_DOWN);
|
boolean isKeyDown = (event.getAction() == KeyEvent.ACTION_DOWN);
|
||||||
if(down != isDown){
|
update(isKeyDown);
|
||||||
isDown = down;
|
}
|
||||||
|
|
||||||
|
public void update(boolean isKeyDown){
|
||||||
|
if(isKeyDown != isDown){
|
||||||
|
isDown = isKeyDown;
|
||||||
Gamepad.sendInput(keycodes, isDown);
|
Gamepad.sendInput(keycodes, isDown);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetButtonState(){
|
public void resetButtonState(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user