private static final KeyBinding createKeyBinding(String description, IKeyConflictContext keyConflictContext, int keyCode, String category) { return new KeyBinding(VillagerInventoryMod.MODID + ".key." + description, keyConflictContext, keyCode, VillagerInventoryMod.MODID + ".key.categories." + category); }
@Override public boolean conflicts(IKeyConflictContext other) { return false; }
/** * Add a new keybinding to get registered */ public static void setDefaultKeyBinding(String description, IKeyConflictContext keyConflictContext, KeyModifier keyModifier, int keyCode, String category) { KeyBinding keyBinding = new KeyBinding(description, keyConflictContext, keyModifier, keyCode, category); keyBindings.put(description, keyBinding); keyBindingsToRegister.add(keyBinding); }
/** * @param id The id of the {@link KeyBinding}. Could be simple like "hit" or "toggle". Also key be default style, * "key.xxx". * @param keyCode The Key code, see {@link org.lwjgl.input.Keyboard}. * @param category The category of the {@link KeyBinding}. * @param context The conflict context of the {@link KeyBinding}. * @return A new keyBinding */ public static KeyBinding create(String id, int keyCode, String category, IKeyConflictContext context) { KeyBinding binding = create(id, keyCode, category); binding.setKeyConflictContext(context); return binding; }