Howdy, Stranger!

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

Supported by

form_text_input doesn't respond after 2 lines

edited January 2 in OpenSesame

Hi all,

I added to an experiment a form_text_input (from the plugin) and for some reason after typing two lines, the text box stops responding (see attached photo where it stopped responding). Any idea what seems to be the problem?

Comments

  • Hi Noam,

    Thanks for pointing this out! It's certainly a bug, and I've filed an issue for it. For now I'm not sure what causes it. But as a workaround you can use a different backend, because the issue only affects the xpyriment backend.

    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

  • Thanks Sebastian, I switched to psycho backend as you suggested and now it works fine.

  • Hi again, I think I may have found another bug. When using psycho backend, you can't use CAPS or any punctuation marks in the text_input form.
    When using Legacy everything seems to be fine but I'm hesitant about using it because I have read that timing is not ideal.

  • HI Noam,

    Thanks again for pointing this out.

    The issue with the xpyriment backend will be fixed in the next maintenance release (3.2.7). For now, you can implement the fix by replacing the get_key() function with a fixed version, using the code below, which should go into the Prepare phase of an inline_script at the very start of the experiment.

    The issue with the psycho backend is a bit trickier and I have to think about the best way to fix it. For now I filed another issue for it.

    Cheers!
    Sebastiaan

    from openexp.backend import configurable
    from openexp._mouse import xpyriment
    import pygame
    from pygame import *
    
    
    @configurable
    def get_click(self):
    
        buttonlist = self.buttonlist
        timeout = self.timeout
        pygame.mouse.set_visible(self.visible)
        start_time = pygame.time.get_ticks()
        time = start_time
        while True:
            time = pygame.time.get_ticks()
            # Process the input
            for event in pygame.event.get():
                if event.type == KEYDOWN:
                    if event.key == pygame.K_ESCAPE:
                        self.experiment.pause()
                        continue
                    pygame.event.post(event)
                if event.type == MOUSEBUTTONDOWN:
                    if buttonlist is None or event.button in buttonlist:
                        pygame.mouse.set_visible(self._cursor_shown)
                        return event.button, self.from_xy(event.pos), time
            if timeout is not None and time - start_time >= timeout:
                break
        pygame.mouse.set_visible(self._cursor_shown)
        return None, None, time
    
    
    xpyriment.xpyriment.get_click = get_click
    

    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

  • Thanks Sebastian, the fix works and I will carry on with the xpyriment backend using the fix you offered.

    Best,

    Noam

Sign In or Register to comment.