Sorry lads, will try to be more clear.
Originally, I was putting together what is essentially a keyboard using the Leonardo. An array of a dozen buttons, so when you hit one, it sends a corresponding keystroke. I was going to use potentiometers for a couple of the commands (for example, radar range is increased by repeatedly pressing +, or decreased by pressing -) The code I was using is in the original post, and it works fine.
Unfortunately, as I sat down to put it together, I realized I needed more than a dozen. I need 24 digital inputs and 3 analog. Obviously, this is more than the Leonardo can provide, so I ordered 3x 74HC165 breakout boards from Sparkfun that can be daisy chained, and require three pins on the Leonardo to control (SCK, MISO, and one of the digital pins, via SPI) that should be here later in the week. (So don't have them on hand to play with them yet, but they seem extremely straightforward in terms of wiring). But if I can add two shift registers to the Leonardo, then I lose three digital pins, but gain 16. Which means plenty of buttons, and can add an LCD as well, if needed.
I've been scouring the web for tutorials on adding the 74HC165, and the one I've been focusing on is Nick Gammon's here: Gammon Forum : Electronics : Microprocessors : Using a 74HC165 input shift register
The problem I'm having is wrapping my head on reading the button press from the shift register, and translating that to a keyboard.write. Which I'm sure for many of you is idiotic, and something I should know. But just started with Arduinos a fortnight ago, and am fumbling in the dark for the most part.