Keys are polled into the ROM system variable LAST K ($5C08) and mirrored to var_last_key throughout the game. The same physical key can mean different things depending on which encounter is active.
Café door
Key Effect
E Enter the café
Q Close the door without entering
Café (inside)
Key Effect
S Mobster present: accept his deal (buy/sell)
N Mobster present: decline his deal
S No mobster: ask for the bill and leave
Old woman
Key Effect
A Rob at gunpoint (requires the gun)
V Rape (requires the gun)
0 (zero) Fire the gun - hero refuses: "Não mato mulheres"
Q Leave without acting
Thief
Key Effect
0 (zero) Fire the gun - shoots the thief, at any moment during the encounter
Prostitute
Key Effect
S Accept her opening line
N Refuse her opening line
Q Refuse her opening line (same as N)
F Vaginal sex, once in her room
C Anal sex, once in her room
B Oral sex, once in her room
Police
The police encounter (police) takes no keyboard input at all - whether the officer says "Está tudo bem?" or demands to see papers is decided by a timer, and the outcome (waved through, or arrested for not carrying a wallet) depends only on whether the hero has a wallet.
High-score name entry
Any key types into the name; ENTER confirms it, then S saves the score and N lets the hero retype it (score_hiscore_check_0, confirmation at score_hiscore_check_3).