Open LeonardoJost opened 4 years ago
Thanks for reporting this. In the debug window there should be a more elaborate error message, i.e. a traceback
. Could you post that here?
Sure, I have run the program and entered 'abcdä' into the text field and it crashed upon entering 'ä'. Here is the traceback:
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\inline_script.py", line 116, in run
self.workspace._exec(self.crun)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\base_python_workspace.py", line 124, in _exec
exec(bytecode, self._globals)
Inline script, line 13, in <module>
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\widgets\_form.py", line 233, in _exec
key, timestamp = kb.get_key()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\openexp\backend.py", line 180, in inner
retval = fnc(self, *arglist, **kwdict)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\openexp\_keyboard\psycho.py", line 93, in get_key
keys = event.getKeys(keylist, modifiers=True)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\psychopy\event.py", line 329, in getKeys
keyNames = [(k[0], modifiers_dict(k[1])) for k in targets]
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\psychopy\event.py", line 253, in modifiers_dict
'MOD_SCROLLLOCK'
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\psychopy\event.py", line 244, in <dictcomp>
return {(mod[4:].lower()): modifiers & getattr(sys.modules[__name__], mod) > 0 for mod in [
TypeError: unsupported operand type(s) for &: 'float' and 'int'
Hi, I have raised this issue on the forum and it seems to be a bug: https://forum.cogsci.nl/index.php?p=/discussion/5607/problem-with-entering-non-ascii-characters-in-text-input-form-with-psychopy-backend#latest I have also found this bug in closed issues for 3.2.7 https://github.com/smathot/OpenSesame/issues/651 but recreated it in 3.2.8.
When creating custom text input forms using OpenSesame with psychoPy backend and entering any special character (e.g. äöüß), the program ends with
TypeError: unsupported operand type(s) for &: 'float' and 'int'
The program ends as soon as the character is entered and I cannot avoid this by defining key_filters. This is with psychoPy backend, with xpyriment no errors occur. A working simple program recreating this problem on my computer (using a german keyboard) is below.