Skip to content

Keybinds V2#68

Open
SpaceWalkerRS wants to merge 1 commit into
gen2from
keybinds-v2
Open

Keybinds V2#68
SpaceWalkerRS wants to merge 1 commit into
gen2from
keybinds-v2

Conversation

@SpaceWalkerRS
Copy link
Copy Markdown
Member

This is a small update to the Keybinds API to make it more consistent with the new Blocks and Items API.

Changes

KeybindRegistry is a helper class with static access to the keybind registry, including registration methods. The REGISTER_KEYBINDS event no longer supplies a registry instance, and modders should register their custom keybinds statically.

KeybindEvents.REGISTER_KEYBINDS.register(() -> {
	cookieKeybind = KeybindRegistry.register("cookie", GLFW.GLFW_KEY_Z, "example");
});

Keybind Categories

V2 adds support for keybind categories to versions below 1.7. These are unused as the API does not modify the controls screen.

Notes on V1

The Keybinds V1 API is still present, but marked deprecated, and will be removed at a later date. The V1 API now internally makes use of the V2 API to function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant