Printing keyboard input to the screen

Dear all

I am trying to print the keyboard input to the screen and allow the user to write a sentence or a word, I used event.waitKeys() to get the keyboard input, the problem is when the user press Space it returns 'Space' as a text not the white space ' '. same as for all special characters.

anybody can help
Hosam Alqaderi

You will have to take care of that yourself, i.e., check the return value of waitKeys() and adjust the result accordingly. You can find out the key names using this new, recently provided Builder demo: https://raw.githubusercontent.com/psychopy/psychopy/master/psychopy/demos/builder/keyNameFinder/keyNameFinder.psyexp

1 Like

In particular, it’s probably easiest to use output.replace(‘Space’, ’ ')

1 Like

Is there any good solution how to print the input on the screen in online studies. My current approach only worked fine offline

I’ve made my template public. It has an age question which allows numbers to be entered.

Try it here (last screen disabled to prevent consumption of credits):

https://run.pavlovia.org/Wake/brookes-template-2020/html/

Best wishes,

Wakefield