Switches for cordless vacuum cleaners