Added keybinding to toggle if hud is shown

This commit is contained in:
Gig 2015-06-14 20:53:05 +01:00
parent 59d4199260
commit 98c8f43b84
6 changed files with 118 additions and 48 deletions

View file

@ -0,0 +1,14 @@
package techreborn.client.keybindings;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import techreborn.lib.ModInfo;
public class KeyBindings {
public static KeyBinding config = new KeyBinding(ModInfo.Keys.CONFIG,
Keyboard.KEY_P, ModInfo.Keys.CATEGORY);
}

View file

@ -0,0 +1,25 @@
package techreborn.client.keybindings;
import techreborn.lib.Key;
import techreborn.util.LogHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
public class KeyInputEventHandler
{
private static Key getPressedKeybinding()
{
if (KeyBindings.config.isPressed()) {
return Key.CONFIG;
}
return Key.UNKNOWN;
}
@SubscribeEvent
public void handleKeyInputEvent(InputEvent.KeyInputEvent event)
{
LogHelper.info(getPressedKeybinding());
}
}