A 3-axis accelerometer is the easiest way to do this as long as the sensor is not moving/accelerating.
The Earth’s gravity is the reference for the accelerometer and then some trig will give the 3D tilt angle from the accelerometer’s 3 axis values. Look into code for a tilt compensated Compass for how to use an accelerometer to find the tilt angles.
If you really wish to go with the analog ‘button’ approach look into linear displacement sensors. With three distances the trig will be harder than with the accelerometer and the cost should be about 1000 times higher and the size about 100 time bigger than using an accelerometer.