Post #9 by @alto777 where he provides an example that uses a range of values for the test expression in each case rather than just a single value. I wasn't aware that was possible, e.g.:
It perhaps looks neater than having several if statements:
How about what I was talking about in post #7, you didn't have any external pullup resistors.
You needed them to pull the input pin to Vcc when your button isn't shorting the input to gnd.
Implementing "INPUT_PULLUP" accomplished the same thing.
There are 4 buttons and they are all connected to Analog Pin 0. Each press has the different voltage value dropped with resistor(s). So analogRead function is needed.
Mebbe so, @alto777, but I use a similar technique to scan up to 27 buttons on A7 of a Nano. It takes some work to code succinctly, and there are differences in my circuit that improve accuracy and response, but the approach of using resistors and an analog input is quite valid and robust, when coded decently. Five equal resistors shouldn't be an issue. I'm reading buttons up to 15' away without any issues to date.
My circuit differs quite a bit, but the end result is a voltage at the input that clearly indicates which button has been pressed, The underlying assumption is, no one will be foolish enough to press 2 or more buttons simultaneously.
As for the OP's circuit, it's not ideal, but not fatally flawed as far as I can see.