@TheAlmightySnark can probably explain the electronic magic going on…
I just follow the recipe and know that if I connect the shift register to 5 pins on the microcontroller, where two are power and ground, I get to link 8 button inputs to it.
That may not sound too impressive, but I can mount a bunch of shift registers in series, and still only need 5 pins on the controller. Say 4 shift registers. That is 4x8=32 buttons and just 5 leads, going to 5 pins. A lot easier than making a good oldfashioned button matrix, that would require 6+6 pins on the controller.
This gets really important when sending button inputs from a stick grip, or a throttle handle, to the controller, because of the limited space available.
I made my ConTrollR throttle box using a button matrix, and that PCB was 80x87mm and all I could fit inside the throttle handle was 3 buttons (6 leads).
This controller will have a 85x40 PCB inside the stick base that will take 16 button inputs and another two PCB of 23x30mm, inside the handle, that will take another 16.
The ConTrollR PCB
Note that the relative scale is off here.