PennController for IBEX › Forums › Support › Logging a Key Press in a Selector
Tagged: Data Logging, Selector element
- This topic has 2 replies, 2 voices, and was last updated 3 years ago by
jkesan.
-
AuthorPosts
-
October 16, 2022 at 8:36 pm #9579
jkesanParticipantI am working on a change detection task where participants should indicate whether they notice a difference between two images by pressing “F” or “J”. I have used the selector element to randomize where the images appear. An example of the code is below. This is basically working as intended. The issue is that this code leads PCIbex to log the name of the image associated with the button press–(eg. FileDb1 or FileDb2). The information I really need here is whether the participant pressed “F” or “J”. I have not found a way to make this change.
My naive intuition is that this should be possible because PCIbex must be identifying which key is being pressed and when in order to report which image was “selected”. Any guidance you can offer regarding this issue would be greatly appreciated.newSelector("selection1") .disableClicks() .add( getImage("File1IDb1") , getImage("File2IDb1") ) .shuffle() .keys("F","J") .wait() .log(),October 17, 2022 at 12:33 pm #9581
JeremyKeymasterHi,
Since your code associates
Fwith the image placed where “File1IDb1” originates, andJwith the image placed where “File2IDb1” originates, and sincelogreports the result ofshufflein the Comments column, you can technically retrieve the key that was pressed from the results file. For example, from this line I can determine that I pressedJ, since I selected the option that is listed second in the last column (File1IDb1):1666024185 REDACTED PennController 0 0 unlabeled NULL Selector selection1 Selection File1IDb1 1666024185448 File2IDb1;File1IDb1
That being said, you can still directly log which key was pressed using a Key element in parallel to the Selector element:
newKey("FJ").log("last") , newSelector("selection1") .disableClicks() .add( getImage("File1IDb1") , getImage("File2IDb1") ) .shuffle() .keys("F","J") .wait() .log() , getKey("FJ").disable()Jeremy
October 17, 2022 at 2:00 pm #9583
jkesanParticipantThank you for your response! It was very helpful.
-
AuthorPosts
- You must be logged in to reply to this topic.