LCD panel switches as analog voltages

Note to mods... feel free to move this thread, which is to do with switches on an LCD panel, not the LCD itself.

I was surprised when I looked at LCD code the first time and found that determining which switch is pressed is done by measuring an analog pin and decoding the 0-1023 reading into a pin identification. Good idea I guess, since that way one could in theory have 1023 switches read on one pin, or more likely say 50-100 if one allowed a reading range of 20-10 per switch to separate them.

I'm curious to know how the wiring would work... I'm ignorant of such things but envisage a unique resistor in series with each switch, a bit like measuring a pot at the junction of the pot and a pull down, where the reading depends on the position of the pot. Does each switch have a resistor of its own and depending on which switch is pressed, that's the resistor in play, and hence a unique reading for that switch?

If that's so, then if the resistors were cunningly chosen I guess this could be used to tell which unique combination of switches was pressed too?

What would be a practical maximum number of switches one could decode on a 0-1023 analog pin?

(It's far too early on a wintry (southern hemisphere) Sunday morning for this.... what am I thinking?)

Ciao,

Jim

Exactly what I was thinking thanks Rob, except for the part where it goes BOOM

I breadboarded it just like that, with whatever resistors I had handy. Did a quick calc to see what portion of the 5v and thus of 1023 should appear on the pin and it worked as expected, identifying the switch that was pressed.