A:
-Go to Shelf Too
-RMB new tool in shelf
-jump inside the tool head to hotkeys tab and press edit in the global hotkeys
The code to put in the tool:
flag = hou.nodeFlag.Display # Change this to the flag you want to toggle
p= hou.ui.paneTabOfType(hou.paneTabType.Parm)
current_node = p.currentNode()
value = current_node.isGenericFlagSet(flag)
current_node.setGenericFlag(flag, not value)
////The current code does this for the display flag but you can make it for any other flag, just replace the first line with flag = ... by the flag you want (see the list here:
http://www.sidefx.com/docs/houdini/hom/hou/nodeFlag.html)
Credits goes to Matthis Bozec. Thank you very much !