Reply To: Track Mouse Position

PennController for IBEX Forums Requests Track Mouse Position Reply To: Track Mouse Position

#8407
mwf2120
Participant

Hi! I am relatively new to Pcibex and am trying to do the following: log coordinate location of images (between 2 and 5 depending on set randomization) that are dragged and dropped to another canvas. The figures can be placed anywhere and in any order on the new canvas. I’d really like to record where they place each figure. I’ve been able to implement the above approach and collect coordinate data, but the method fails when I try to drag and drop (probably because the images are “clicked” in one place and “unclicked” in another). Is there a better way to do this? Thanks so much!

Drag and drop sample approach:

newTrial("Set_2",
    newCanvas("figlist", "72vw","58vh")
        .css("padding","1em")
        .color("lightgray")
        .print("left at 5vw", "middle at 50vh")
    ,
    newCanvas("grid", "72vw", "58vh")
        .css("padding", "1em")
        .color("yellow")
        .print("left at 20vw", "middle at 50vh")
    ,
    newSelector("figures")
    ,
    newImage("man", "man_small.png").selector("figures").print(getCanvas("figlist")),
    newImage("boy", "boy_small.png").selector("figures").print(getCanvas("figlist"))
    ,
    getSelector("figures").shuffle()
        .log()
    ,
    newDragDrop("dd")
       .addDrag(getImage("man"))
       .addDrag(getImage("boy"))
       .addDrop(getCanvas("figlist"))
       .log()
    ,
    newTimer(5000).start()
    .wait()
)

Thanks for any help!