DDNet client has a multitude of commands and settings that can be bound to nearly any key or mouse button. You can enter commands into the console, which by default is accessed by pressing F1.
11:26
or if you want just that one line, bind mouse1 "+fire; +toggle cl_dummy_hammer 1 0"