Eliminate the gravity gun, then grab a Manhack with it. While still holding it, switch to the pistol. Release SHOOT, then select the crowbar. If done correctly, the game will think you are still using the gravity gun, but you can choose any weapon except for the gravity gun. If you select the gravity gun, the glitch will end.