Fixed KeyPreset not fully respecting SHIFT/ALT/CTRL modifiers + removed redundant code

This commit is contained in:
bigguy345 committed 2025-12-20 00:51:33 +02:00
1 parent 1ac7c0e797
commit 950a749be6
2 files changed
+3 -37

No files matched your search

@@ -11,10 +11,8 @@ import java.util.List;
public class KeyPresetManager {
public List<KeyPreset> keys = new ArrayList<>();
public List<KeyPreset> keysSorted = new ArrayList<>();
public String fileName;
private boolean wasSorted = false;
public KeyPresetManager(String fileName) {
this.fileName = fileName;
@@ -23,22 +21,12 @@ public class KeyPresetManager {
public KeyPreset add(String name) {
KeyPreset preset = new KeyPreset(name);
keys.add(preset);
keysSorted.add(preset);
wasSorted = false;
return preset;
}
public void tick() {
if (!wasSorted) {
keysSorted.sort(KeyPreset::compareTo);
wasSorted = true;
}
for (KeyPreset key : keysSorted) {
for (KeyPreset key : keys)
key.tick();
if (key.isDown && key.shouldConflict)
return;
}
}