Remove keycode state forcing
It was a feature that was in the source of MineBot, but was actually never used.
This commit is contained in:
@@ -57,14 +57,8 @@ public final class InputOverrideHandler implements Helper {
|
||||
*/
|
||||
private final Map<KeyBinding, Boolean> inputForceStateMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Maps keycodes to whether or not we are forcing their state down.
|
||||
*/
|
||||
private final Map<Integer, Boolean> keyCodeForceStateMap = new HashMap<>();
|
||||
|
||||
public final void clearAllKeys() {
|
||||
inputForceStateMap.clear();
|
||||
keyCodeForceStateMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,25 +81,6 @@ public final class InputOverrideHandler implements Helper {
|
||||
inputForceStateMap.put(input.getKeyBinding(), forced);
|
||||
}
|
||||
|
||||
/**
|
||||
* A redirection in multiple places of {@link Keyboard#isKeyDown}.
|
||||
*
|
||||
* @return Whether or not the specified key is down or overridden.
|
||||
*/
|
||||
public boolean isKeyDown(int keyCode) {
|
||||
return Keyboard.isKeyDown(keyCode) || keyCodeForceStateMap.getOrDefault(keyCode, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether or not the specified key code is being forced down.
|
||||
*
|
||||
* @param keyCode The key code
|
||||
* @param forced Whether or not the state is being forced
|
||||
*/
|
||||
public final void setKeyForceState(int keyCode, boolean forced) {
|
||||
keyCodeForceStateMap.put(keyCode, forced);
|
||||
}
|
||||
|
||||
/**
|
||||
* An {@link Enum} representing the possible inputs that we may want to force.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user