It's impossible to follow the row/column wiring. Maybe using a different colour wire for rows will make it more obvious.
As the lilly has so few pins your going to have to use external hardware. I'm not sure if parallel in/serial out chips would be suitable as you would need to continually read them slowing down other code and/or making keyboard less responsive.
Maybe there are dedicated keyboard matrix chips you could use or hack the electronics from a PS/2 keyboard.
It's impossible to follow the row/column wiring. Maybe using a different colour wire for rows will make it more obvious.
As the lilly has so few pins your going to have to use external hardware. I'm not sure if parallel in/serial out chips would be suitable as you would need to continually read them slowing down other code and/or making keyboard less responsive.
Maybe there are dedicated keyboard matrix chips you could use or hack the electronics from a PS/2 keyboard.
The idea seems sound but needs another MCU to handle the key matrix, maybe you can hack a PS/2 keyboard to suit your needs (assuming your keyboard is customized in some way and a normal keyboard is not suitable) and use current code & 2 lilly pins to read it Arduino Playground - PS2Keyboard