Howdy, Stranger!

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

Supported by

text input as canvas in inline_script

@eduard and others:
Do you know how to create a text input canvas in an inline_script?

Comments

  • When i use the text_input_form performance is very slow. Or i am typing too fast ;)
    Not all the letters appear in the text.
    So i thought to try another way.

  • When i use the text_input_form performance is very slow.

    This is a known issue with the xpyriment and psycho backends. If you switch to legacy, you'll find that it works smoothly. But that's not always ideal either, of course. So more tips are on this page:

    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

  • How do i make the mouse disappear after the text_input ?

    from libopensesame import widgets
    my_form = widgets.form(exp, cols=1, rows=3)
    
    # add instruction
    label = widgets.label(my_form, text='Ist Ihnen während den 12 Blöcken etwas aufgefallen?')
    label2 = widgets.label(my_form, text='Bitte langsam schreiben. Mit Enter beenden.')
    
    # add text input box
    text_input = widgets.text_input(my_form, var='response', return_accepts=True)
    text_input.__init__(my_form, stub='Mir ist aufgefallen, dass ...' , return_accepts=True, var='response')
    
    rect= (0,0,0,0)
    text_input.set_rect(rect)
    
    my_form.set_widget(label, (0,0))
    my_form.set_widget(label2, (0,1))
    my_form.set_widget(text_input, (0,2))
    my_form._exec()
    
    #mouse.show_cursor(show=False) 
    ### ERROR ###  'function' object has no attribute 'show_cursor'
    
    #present any other object without having a mouse on the screen
    my_canvas = canvas()
    my_canvas.fixdot()
    my_canvas.show()
    leer=keyboard(keylist=['SPACE'])
    leer.get_key()
    
  • The thing to know is that mouse() is not itself a mouse object, but a function that returns a mouse object when you call it. So if you want to change the visibility of the cursor immediately, you should first create a mouse object and then call show_cursor() on it. Like so:

    my_mouse = mouse() # Create a new mouse object
    my_mouse.show_cursor(False) # And hide the cursor!
    

    (In other words, it works just like with a canvas object.)

    You can combine this into a single line, like so:

    mouse().show_cursor(False)
    

    Cheers!

    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.