I made a menu using dat.gui for my applcation with Three.js. It works fine, I have also discovered that pressing h key I can hide the menu created with dat.gui. My question is h
What you and I were looking for is
var gui = new dat.GUI();
// to toggle it closed
gui.closed = true;
// to toggle it open again
gui.closed = false;
I got this from the source at line 2104 where the internal functions open and close are doing exactly this.
The gui reacts to the value change on the fly (you can reassign gui.closed from the console to see it in action).