Class KeyRegistry
java.lang.Object
org.cyclops.cyclopscore.client.key.KeyRegistry
- All Implemented Interfaces:
IKeyRegistry
,IRegistry
Enum that contains all custom hotkeys that
are added. Every key also has a
KeyMapping
for that specific key.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addKeyHandler
(net.minecraft.client.KeyMapping kb, IKeyHandler handler) Binds aIKeyHandler
to key presses of the specifiedKeyMapping
.static net.minecraft.client.KeyMapping
newKeyMapping
(ModBase mod, String name, int defaultKey) Create a new keybinding.void
onPlayerKeyInput
(net.minecraftforge.client.event.InputEvent.Key event) Handles key presses for keybindings added by EvilCraft Make sure to annotate this withSubscribeEvent
-
Constructor Details
-
KeyRegistry
public KeyRegistry()
-
-
Method Details
-
newKeyMapping
public static net.minecraft.client.KeyMapping newKeyMapping(ModBase mod, String name, int defaultKey) Create a new keybinding.- Parameters:
mod
- The mod.name
- The unique name.defaultKey
- The keycode.- Returns:
- A new keybinding.
-
onPlayerKeyInput
public void onPlayerKeyInput(net.minecraftforge.client.event.InputEvent.Key event) Description copied from interface:IKeyRegistry
Handles key presses for keybindings added by EvilCraft Make sure to annotate this withSubscribeEvent
- Specified by:
onPlayerKeyInput
in interfaceIKeyRegistry
- Parameters:
event
- The input event.
-
addKeyHandler
Description copied from interface:IKeyRegistry
Binds aIKeyHandler
to key presses of the specifiedKeyMapping
. Whenever theKeyMapping
is pressed,IKeyHandler.onKeyPressed(KeyMapping)
} is called.- Specified by:
addKeyHandler
in interfaceIKeyRegistry
- Parameters:
kb
-KeyMapping
to which we bind theIKeyHandler
.handler
-IKeyHandler
that will be linked to presses of the givenKeyMapping
.
-