cl_grenade_auto_switch (from ins&doi,If enabled, automatically switch to primary after throwing a grenade
)
cl_autowepswitch (from Counter-Strike,when you pickup item you can choose switch it or not)
I think UE4 can do this.