mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-14 07:35:10 +01:00
Mixed input & Fix multiple issues
- Update to 1.20.4 - Touch can now be used in controller mode (especially nice on Steam Deck) - Added option to choose between camera modes (Flat vs. Adaptive, addresses #232) - Fixed broken button binding (#235)
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
|
||||
*
|
||||
* This file is part of midnightcontrols.
|
||||
*
|
||||
* Licensed under the MIT license. For more information,
|
||||
* see the LICENSE file.
|
||||
*/
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.enums;
|
||||
|
||||
/**
|
||||
* Represents a button state.
|
||||
*
|
||||
* @author LambdAurora
|
||||
* @version 1.1.0
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public enum ButtonState {
|
||||
NONE(0),
|
||||
PRESS(1),
|
||||
RELEASE(2),
|
||||
REPEAT(3);
|
||||
|
||||
public final int id;
|
||||
|
||||
ButtonState(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this state is a pressed state.
|
||||
*
|
||||
* @return true if this state is a pressed state, else false
|
||||
*/
|
||||
public boolean isPressed() {
|
||||
return this == PRESS || this == REPEAT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this state is an unpressed state.
|
||||
*
|
||||
* @return true if this state is an unpressed state, else false
|
||||
*/
|
||||
public boolean isUnpressed() {
|
||||
return this == RELEASE || this == NONE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user