Modern KeyBinding

Modern KeyBinding is a mod that allows keybinding changes, being a newer version ports of KeyModifier && KeyConflictContext back to Forge 1.7.10/1.8.9 and Legacy Fabric 1.7.10/1.8.9.

GitHub Description
Description link

Import as a gradle dependency

Check the latest version on JitPack.

repositories { //...   maven { url 'https://jitpack.io' } }

dependencies { //...   implementation 'com.github.Nova-Committee:ModernKeyBinding:Forge-1.7.10-1.2.0' }

Register a keybinding
Register a keybinding that:

-Activates when Alt and C are pressed;

-Only available in GUI.

ClientProxy.java

public class ClientProxy {

public void init(final FMLInitializationEvent event) {

//...

yourKeyBinding = KeyBindingRegistry.INSTANCE.registerKeyBinding("key.exampleKey", KeyConflictContext.GUI, KeyModifier.ALT, Keyboard.KEY_C, "key.categories.example");

}

}

Change the properties of an existing keybinding
ClientProxy.java

public class ClientProxy {

//...

public void postInit(final FMLPostInitializationEvent event) {

final IKeyBinding extended = (IKeyBinding) yourKeyBinding;

// Change the key's keyCode and modifier, as their default values.

extended.setInitialKeyModifierAndCode(KeyModifier.ALT, Keyboard.KEY_E);

// Change the key's keyCode and modifier.

extended.setKeyModifierAndCode(KeyModifier.ALT, Keyboard.KEY_E);

// Change the key's conflict context.

extended.setKeyConflictContext(KeyConflictContext.IN_GAME);

}

}

Modrinth Description
The mod ported newer version's KeyModifier && KeyConflictContext back to Forge 1.7.10 / 1.8.9.

Features

You can now define a keybinding's activation key with key modifiers. Like "Ctrl + G" or "Alt + S";

The keybindings with the same activation key but different key conflict contexts no longer conflict.

"Non-conflict keys" (disabled by default): The keybindings with the same key will all be activated if the key is pressed.

Attention:

The mod will crash with NEI. Use NEI Unofficial (Dependencies: CodeChickenCore | CodeChickenLib) by GTNH instead.

Import as a Gradle dependency

Check the lastest version on JitPack.

repositories { //...   maven { url 'https://jitpack.io' } }

dependencies { //...   implementation 'com.github.Nova-Committee:ModernKeyBinding:Forge-1.7.10-2.0.0' }

Register a keybinding
Register a keybinding that:

-Activates when Alt and C are pressed;

-Only available in GUI.

ClientProxy.java

public class ClientProxy {

public void init(final FMLInitializationEvent event) {

//...

yourKeyBinding = KeyBindingRegistry.INSTANCE.registerKeyBinding("key.exampleKey", KeyConflictContext.GUI, KeyModifier.ALT, Keyboard.KEY_C, "key.categories.example");

}

}

Change the properties of an existing keybinding
ClientProxy.java

public class ClientProxy {

//...

public void postInit(final FMLPostInitializationEvent event) {

final IKeyBinding extended = (IKeyBinding) yourKeyBinding;

// Change the key's keyCode and modifier, as their default values.

extended.setInitialKeyModifierAndCode(KeyModifier.ALT, Keyboard.KEY_E);

// Change the key's keyCode and modifier.

extended.setKeyModifierAndCode(KeyModifier.ALT, Keyboard.KEY_E);

// Change the key's conflict context.

extended.setKeyConflictContext(KeyConflictContext.IN_GAME);

}

}