psychopy.org | Reference | Downloads | Github

Problem with keyname finder demo

Hi,

I am using the standaIone 1.84.2 version on a windows 10. I am trying to find the keynames for turkish characters using the keyname finder demo but everytime I press a Turkish character I receive this message:

messFormat = “That key was:\n\n’{0=’\nPress another key”.format(lastKey)
UnicodeEncodeError: ‘acii’ codes can’t encode character u’\u011f’ in position 0: ordinal not in range(128)

I received the same message when I tried a windows 7 desktop.
What should I do?

Not by my computer, but I may have simply forgotten to put a u in front of that string. In the folder where you unpacked the demos, find the main py file (probably keyNameFinder.py or something similar), find the line with:

messFormat = "That key was:\n\n\'{0}\'\nPress another key".format(lastKey)

And change it to this, simply adding a u.

messFormat = u"That key was:\n\n\'{0}\'\nPress another key".format(lastKey)

My apologies.

I added that u, and keyname finder did show me keynames like this:
ğ = ğ
ü= ü
and so on. So I added them like this to the magnificient setupkeys routine you wrote, and the Turkish characters did not show. psychopy did not close itself when I hit those keys but they do not show either. Furthermore, even for the words without any Turkish characracters, when I write the correct answer it gives me a wrong response like: Wrong. You wrote teyze, but the correct answer is teyze.

I have no idea what to do :cry:

We’ll take care of your experiment in that other thread. So if adding the u fixed this bug, you could mark this as solved. To the developers, I will hopefully submit a pull request later today.