Use key responses as triggers

Your problem is here:

As the API shows (psychopy.parallel - functions for interacting with the parallel port — PsychoPy v2023.2.3), the .setData() function sends one byte. You are feeding it a multi-character string, which by definition will contain more than one byte’s worth of data.

The parallel port is a very low level interface in this day and age. You are literally controlling the voltages on individual lines in a cable. You can’t just send arbitrary information on that old-school channel.