public final class KeyBindingHelper extends Object
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"));
Modifier and Type | Method and Description |
---|---|
static net.minecraft.client.util.InputUtil.Key |
getBoundKeyOf(net.minecraft.client.options.KeyBinding keyBinding)
Returns the configured KeyCode bound to the KeyBinding from the player's settings.
|
static net.minecraft.client.options.KeyBinding |
registerKeyBinding(net.minecraft.client.options.KeyBinding keyBinding)
Registers the keybinding and add the keybinding category if required.
|
public static net.minecraft.client.options.KeyBinding registerKeyBinding(net.minecraft.client.options.KeyBinding keyBinding)
keyBinding
- the keybindingpublic static net.minecraft.client.util.InputUtil.Key getBoundKeyOf(net.minecraft.client.options.KeyBinding keyBinding)
keyBinding
- the keybinding