Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] to_chr problem with new version

edited October 2015 in OpenSesame

Hi all,

The following code

   if my_keyboard.to_chr(key) == "backspace":
        resp = resp[:-1]

was working well but with OS new version, I get this message:
AttributeError: 'psycho' object has no attribute 'to_char'

Would you have any idea of the solution?

Best regards,

Comments

  • edited 7:41AM

    Hi Boris,

    Way, way, back, keyboard.to_chr() was necessary to convert keyboard codes to characters. For a long time, the function was still there but didn't do anything. And now it's removed.

    This will do the trick though:

    if key == "backspace":
            resp = resp[:-1]
    

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.