![]() I’d used print() arguments in the past for this problem with no luck, but I had some success just now when I added print() arguments following if keys = ' * '. Psychopy scale reset update#Thanks in advance for your time!Įdits: to clarify wording and update script after I’ve tried other solutions Psychopy scale reset code#If len(kb.getKeys(, waitRelease = True, clear = False)) > 0:Įlif len(kb.getKeys(, waitRelease = False, clear = False)) > 0:įor the sake of sharing replicable code and not spamming this post, I’ve isolated the necessary code and made it available, along with necessary stimuli, here. If len(kb.getKeys(, waitRelease = False, clear = False)) > 0: If len(kb.getKeys(, waitRelease = True, clear = True)) = 0 or len(kb.getKeys(, waitRelease = True, clear = True)) = 0: # If either boolean is 'True', simply holding down the button will not yield continuous incrementing in the rating # When the left key is pressed and not released, keys = LEFT I’m assuming I must have a flaw in my logic somewhere, but after about a week of workshopping this, I’m at a loss: kb = keyboard.Keyboard() It seems like although I’m changing the value of keys I’m not actually clearing the event memory, but I don’t know why that’s happening. print() functions have demonstrated that the value of keys does successfully reset with each frame, but it seems once it gets to the conditionals, it feels that the conditions to change keys to either ‘LEFT’ or ‘RIGHT’ have been met, despite no buttons being pressed. From wherever the scale currently sits, it progresses to one of the two poles and it stays at that terminal position, no matter what button states exist afterward. When the rating scale oscillates enough times, it will break. When keys are released, event.clearEvents() clears the memory buffer, effectively changing the value of keys back to ‘STOP’. For every frame that keys takes a ‘LEFT’ or ‘RIGHT’ value because of the key presses, the scale will increment 1% in the respective direction. When these conditions are met, a variable keys changes value. To give an idea of what it looks like.Įvent.getKeys() tracks when either the 2 or 3 buttons are pressed, but not yet released. I have a task which plays a video using VLCMovieStim and, every frame, collects ratings on a continuous bipolar scale. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |