While standing above a Boomshield, equip your pistol. Perform a melee attack and quickly press X + D-pad Left or Right. If done correctly, you should now be using whatever weapon was in the left or right slot with your Boomshield equipped. This will not work with a Mulcher or mortar as they do not occupy an actual weapon slot.