Text input without mouseclick + key restrictions for text input
I am planning an experiment with a text input and have a few problems I can't overcome. A short summary for the procedure:
People receive two statements about objects (e.g. The apple left of the pear; The Banana is right of the pear). After reading the statments they shall write the first letter of each oject in one text file.
Lets say the solution is Apple Pear Banana. They have to type A P B.
Now.. there are always two correct possibilities (revision_ro and revision_lo) and all other are wrong. I want the two correct onces to be coded sperately because it serves important information. I made a python script like this:
from libopensesame import widgets form = widgets.form(exp) text_input = widgets.text_input(form, stub = 'Schreibe hier.. ', center=True, frame = True, var='user_input', return_accepts=True) form.set_widget(text_input, (0,0)) form._exec(focus_widget=None) if var.user_input == var.revision_lo: var.correctness = 1 elif var.user_input == var.revision_ro: var.correctness = 2 else: var.correctness = 0 print(var.user_input) print(var.revision_lo) print(var.revision_ro) print(var.correctness)
This script works, but:
1. Participants always have to click into the text field before they can start writing. Is there a way to change this? Because of this my reaction times vary way to much
2. is there a way to restrict the input keys? I only want them to type letters like A P B. No numbers, or other stuff