-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a keybind
This guide assumes you've already created and setup an Avoid project.
This guide uses meta-programming. Another way may either not be implemented or you may need to figure it out on your own.
§ Making a keybind with the Avoid Framework
-
Create a java class;
You can pick any location within your project source code directory. -
Paste the following code:
package com.example.avoidtmpl; import pl.olafcio.avoid.mods.annotation_processor.KeyHandler; import pl.olafcio.avoid.net.keyboard.Keyboard; public class KeyListener { @KeyHandler(Keyboard.B) public static void b() { System.out.println("B pressed!"); } }
Of course you need to replace the class name and package.
You can also paste the method in any existing class instead.
You can also change the method's name to anything you want. -
Customize it as you wish;
To change the keybind that triggers the method, change the value inside the@KeyHandler(...)declaration.
©️ Copyright 2026 Olafcio (on behalf of the AvoidLib org)
📝 Licensed with CC BY-NC (Attribution-NonCommercial)