mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Fix conflicting keybindings not having the correct click count set. #9360
This commit is contained in:
1 parent
03a505a3f2
commit
cf3d42ef38
4 files changed
+82
-1
No files matched your search
@@ -27,6 +27,7 @@ public class KeyMappingLookup
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
@Nullable
|
||||
public KeyMapping get(InputConstants.Key keyCode)
|
||||
{
|
||||
@@ -59,6 +60,16 @@ public class KeyMappingLookup
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all active keys associated with the given key code and the active
|
||||
* modifiers and conflict context.
|
||||
*
|
||||
* This could probably be renamed to something like getActiveMappings, but
|
||||
* that would be a breaking change.
|
||||
*
|
||||
* @param keyCode the key being pressed
|
||||
* @return the list of key mappings
|
||||
*/
|
||||
public List<KeyMapping> getAll(InputConstants.Key keyCode)
|
||||
{
|
||||
List<KeyMapping> matchingBindings = new ArrayList<KeyMapping>();
|
||||
@@ -67,7 +78,11 @@ public class KeyMappingLookup
|
||||
Collection<KeyMapping> bindings = bindingsMap.get(keyCode);
|
||||
if (bindings != null)
|
||||
{
|
||||
matchingBindings.addAll(bindings);
|
||||
for (KeyMapping binding : bindings)
|
||||
{
|
||||
if (binding.isConflictContextAndModifierActive())
|
||||
matchingBindings.add(binding);
|
||||
}
|
||||
}
|
||||
}
|
||||
return matchingBindings;
|
||||
|
||||
Reference in new issue
Block a user