From e05a25fc80e7b7b62669aa4b79452861392082b6 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Tue, 7 Jun 2022 18:52:31 -0500 Subject: [PATCH] Fix overwriting presses and releases Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- src/sig/engine/KeyBind.java | 8 +++----- src/sig/objects/ConfigureControls.java | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/sig/engine/KeyBind.java b/src/sig/engine/KeyBind.java index 38a7236..3d8d329 100644 --- a/src/sig/engine/KeyBind.java +++ b/src/sig/engine/KeyBind.java @@ -79,23 +79,21 @@ public class KeyBind { //Polls all KeyBinds based on device. for (Action a : Action.values()) { boolean held = false; - KeyBind cc = null; for (KeyBind c : KEYBINDS.get(a)) { held = c.isKeyHeld(); - actionEventCheck(a,held); if (held) { - cc=c; break; } } - if (held) { + actionEventCheck(a,held); + /*if (held) { if (KEYBINDS.get(a).get(0)!=cc) { for (int i=0;i clist = KeyBind.KEYBINDS.get(selectedAction); - clist.add(new KeyBind(RabiClone.CONTROLLERS[i],e.getComponent().getIdentifier(),e.getValue())); + Identifier id = e.getComponent().getIdentifier(); + if (id==Identifier.Axis.POV) { + if (e.getValue()!=POV.DOWN&& + e.getValue()!=POV.RIGHT&& + e.getValue()!=POV.LEFT&& + e.getValue()!=POV.UP) { + continue; //Can't add ordinal directions, only cardinal. + } + } + clist.add(new KeyBind(RabiClone.CONTROLLERS[i],id,e.getValue())); KeyBind.KEYBINDS.put(selectedAction,clist); assigningKey=false; }