Class KeyMappingUtil

java.lang.Object
dev.munebase.dynamickeybinds.util.KeyMappingUtil

public final class KeyMappingUtil extends Object
Shared key mapping helpers used across loaders.
  • Method Details

    • normalizeId

      public static String normalizeId(String rawId)
      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

      public static String normalizeCategory(String category)
      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