KeyBindingHelper

public final class KeyBindingHelper

Helper for registering key bindings.

Helper class for KeyBinding for use by Fabric mods.

 KeyBinding left = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.example.left", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_P, "key.category.example")); KeyBinding right = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.example.right", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_U, "key.category.example")); 

Functions

getBoundKeyOf
Link copied to clipboard
static InputUtil.Key getBoundKeyOf(KeyBinding keyBinding)
Returns the configured KeyCode bound to the KeyBinding from the player's settings.
registerKeyBinding
Link copied to clipboard
static KeyBinding registerKeyBinding(KeyBinding keyBinding)
Registers the keybinding and add the keybinding category if required.

Sources

jvm source
Link copied to clipboard