Each key sends the same code no matter the setting of the keypad. That is, the starting point. The computer interprets the key presses depending on what sequence it sees. And the computer interprets the meaning of the code sent depending on previous key presses. The code has nine bits.
Every press sends a code and every release sends the same code but for the final bit.
Here are the codes. Only the code sent on the presses is given, for release code change the final 1 to 0.