Skip to content

Keybind Functions

wagyourtail edited this page Sep 20, 2020 · 9 revisions

the keybind functions are:

key(String, Bool)

Example: keybind.key("key.keyboard.w", True);

Presses/Depresses a key.

getKeyBindings() 1.2.2+

Example: keybind.getKeyBindings()

returns a Map<String, String> of keybind -> bound key.

setKeyBind(String, String) 1.2.2+

Example: keybind.setKeyBind(bind, keycode)

sets the bound key for a keybind.

keyBind(String, Bool) 1.2.2+

Example: keybind.keyBind(bindName, pressed)

uses the name of a bind, rather than the name of a key to set the pressed state.

getPressedKeys() 1.2.6+

Example: keybind.getPressedKeys()

returns a List<String> of keys that are currently pressed.

you can probably ignore these ones:

getKeyCode(String)

Example: keybind.getKeyCode("key.keyboard.w");

Returns a net.minecraft.client.util.InputUtil.KeyCode.

key(net.minecraft.client.util.InputUtil.KeyCode, Bool)

Example: keybind.key(keybind.getKeyCode("key.keyboard.w"), True);

Presses/Depresses a key.

Clone this wiki locally