Switch controlled by both mechanical and electrical force