diff --git a/src/main/java/de/bwravencl/controllerbuddy/input/action/ButtonToCycleAction.java b/src/main/java/de/bwravencl/controllerbuddy/input/action/ButtonToCycleAction.java index 87288f8c..cd454010 100644 --- a/src/main/java/de/bwravencl/controllerbuddy/input/action/ButtonToCycleAction.java +++ b/src/main/java/de/bwravencl/controllerbuddy/input/action/ButtonToCycleAction.java @@ -93,7 +93,12 @@ public void doAction(final Input input, final int component, Byte value) { } private void doActionAndAdvanceIndex(final Input input, final int component) { - actions.get(index).doAction(input, component, Byte.MAX_VALUE); + final var action = actions.get(index); + + action.doAction(input, component, Byte.MAX_VALUE); + if (action instanceof final ButtonToLockKeyAction buttonToLockKeyAction) { + buttonToLockKeyAction.resetWasUp(); + } if (index == actions.size() - 1) { index = 0; diff --git a/src/main/java/de/bwravencl/controllerbuddy/input/action/ButtonToLockKeyAction.java b/src/main/java/de/bwravencl/controllerbuddy/input/action/ButtonToLockKeyAction.java index ac13c559..a89c186d 100644 --- a/src/main/java/de/bwravencl/controllerbuddy/input/action/ButtonToLockKeyAction.java +++ b/src/main/java/de/bwravencl/controllerbuddy/input/action/ButtonToLockKeyAction.java @@ -26,7 +26,7 @@ import de.bwravencl.controllerbuddy.input.action.gui.LockKeyEditorBuilder; import java.text.MessageFormat; -@Action(label = "BUTTON_TO_LOCK_KEY_ACTION", category = ActionCategory.BUTTON, order = 116) +@Action(label = "BUTTON_TO_LOCK_KEY_ACTION", category = ActionCategory.BUTTON_AND_CYCLES, order = 116) public final class ButtonToLockKeyAction extends DescribableAction implements IButtonToAction, IInitializationAction { @@ -73,7 +73,7 @@ public LockKey getLockKey() { @Override public void init(final Input input) { - wasUp = true; + resetWasUp(); } @Override @@ -85,6 +85,10 @@ public boolean isOn() { return on; } + void resetWasUp() { + wasUp = true; + } + public void setLockKey(final LockKey lockKey) { virtualKeyCode = lockKey; }