The W key fires the selected weapon that you select using the 1-4 key in the dialogue that lists weapons. IF the weapon selected has shots and ammo of course - if not, it will do nothing AFAIR.
There is no need to use the F key after that unless you want to fire all/assault as usual after firing the one selected weapon.
When I press the W key and then select the weapon, nothing happens. The weapon has plenty of ammo. That's why I then pressed the F key, but then the unit would do a close assault.