you have to actively scan it. for example something like - configure pins 1-4 as opendrain outputs - configure pins 5-8 as inputs with pullup - set pin 1 low, 2-4 high - read pin 5. if low, key `1` is pressed. - read pin 6. if low, key `2` is pressed. - read pin 7. if low, key `3` is pressed. - read pin 8. if low, key `4` is pressed. - set pin 2 low, 1,3,4 high - read pin 5. if low, key `5` is pressed etc