This is really easy. Do a GuyOverlay that only displays a grey/textured rectangle when the 'u' key is pressed. I did it like this and it works great.
To get a GuyOverlay working, youll have to creat a new class that has the following few things in it:
public class YourOverlay extends Gui{
public YOurOverlay(Minecraft mc){
this.mc = mc;
}
@SubscribeEvent(priority = EventPriority.NORMAL)
public void renderOverlay(RenderGameOverlayEvent event){
ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
int k = scaledresolution.getScaledWidth();
int l = scaledresolution.getScaledHeight();
if (event.type != ElementType.ALL) {
return;
}
if (Keyboard.isKeyDown(Keyboard.KEY_U)){
GL11.glPushMatrix();
//Your code here (Youll have to use k as width and l as height!!)
GL11.glPopMatrix();
}
}
}
Then youll have to define a new field in your ClientProxy and register the YourOverlay-class like this in your ClientProxy :
private final Minecraft mc = Minecraft.getMinecraft();
MinecraftForge.EVENT_BUS.register(new YourOverlay(mc));