Options. I suppose you tried this one.
Esc -> go to options -> go to controls -> tab "use weapons", Click next to "switch to alternate", click the button you want to assign.
Bind the key you want to be switch to alternate to +attack2. Assuming you want it to be mouse2:
/unbind mouse2 in your console
/bind mouse2 +attack2 in your console.
/writeconfig autoexec.cfg in your console
Do you know how to open console? Tidle key or ²³key depending on keyboard.
We'll come to that when the former things don't work