Class KeyMappingUtil
java.lang.Object
dev.munebase.dynamickeybinds.util.KeyMappingUtil
Shared key mapping helpers used across loaders.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intextractKeyCode(net.minecraft.client.KeyMapping keyMapping) Extracts key code from key mapping in a mapping-stable way.static StringnormalizeCategory(String category) Normalizes key category for storage.static StringnormalizeId(String rawId) Converts a key mapping name/id to the canonical keybind id used by persistence.
-
Method Details
-
normalizeId
Converts a key mapping name/id to the canonical keybind id used by persistence.- Parameters:
rawId- key mapping name or id- Returns:
- normalized id without `key.` prefix
-
normalizeCategory
Normalizes key category for storage.- Parameters:
category- raw category- Returns:
- normalized category
-
extractKeyCode
public static int extractKeyCode(net.minecraft.client.KeyMapping keyMapping) Extracts key code from key mapping in a mapping-stable way.- Parameters:
keyMapping- key mapping- Returns:
- GLFW key code, or 0 on failure
-