Voltage range acceptance for a divider to detect keystroke

MarkT:
Use a small capacitor on the analog pin to reduce noise from switch-contacts (10nF to
100nF is appropriate.

Always read the analog pin repeatedly till the voltage stabilises - you don't want to
be confused by a transient voltage change during sampling, nor by contact bounce.

In other words, you must "de-bounce" this just as if you were using a digital port. Since you are already using resistors and no key is connected directly to the analog input, a capacitor will provide some degree of de-bounce, but you need to provide a proper routine which performs the "slot" determination each millisecond or so and only when it has determined the voltage to lie within that same "slot" for each of ten successive millisecond samples, judge that to correspond to a valid button press.

Again, you are not expecting to to be the same analog value, but to lie in the same "slot" or range of values.