Logging a Key Press in a Selector

PennController for IBEX Forums Support Logging a Key Press in a Selector

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9579
    jkesan
    Participant

    I 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(),
    #9581
    Jeremy
    Keymaster

    Hi,

    Since your code associates F with the image placed where “File1IDb1” originates, and J with the image placed where “File2IDb1” originates, and since log reports the result of shuffle in 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 pressed J, 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

    #9583
    jkesan
    Participant

    Thank you for your response! It was very helpful.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.