If you find this too complicated, you can use the daskeyboard [https://gitlab.socsci.ru.nl/wilberth/daskeyboard Python library]. Just put the file [https://gitlab.socsci.ru.nl/wilberth/daskeyboard/-/raw/master/daskeyboard.py?inline=false daskeyboard.py] in the same directory as the experiment and use:
+
<source lang="python">
+
import daskeyboard
+
+
daskeyboard.keyColor("g", "blue") # G key becomes blue