Case switch instead of if statement

I don't think you should use switch-case for what you intend to do. A switch-case is used when the input has multiple values but your button can yield only on and off. Just use if statement will do. If you want some efficiency, you can use array to store pins that are connected to buttons and distances that each button represents.