I'm using membrane keypad with raspberry pi, and with the help from pad4pi library.

I can't seem to find the interrupt command in pad4pi library.

What's the interrupt command for any of the keys, i.e. one of the key pressed interrupts the running program?

1 Answer 1



How come there is no interrupt command in the Pad4pi keypad library?


Well, you don't need to write pin interrupt functions yourself.

The python module will setup interrupt pins during start up and interchanging row and columns as interrupt/input and output rows and columns. Everything is done in the background.

You might like to read my answer for more details of the keypad scanning algorithm to the question in Ref 3.

Note the "Is interrupt flag set condition" in Step 2 of the keypad scanning flowchart.


(1) Pad4pi - An interrupt based Python library for reading matrix keypad Raspberry Pi GPIO pins.

(2) AdaFruit Membrane 3x4 Matrix Keypad - $4

(3) Multiple GPIO Buttons


Appendix A - MicroChip Keypad Scanning Algorithm - MicroChip

keypad scan method


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.