kurokida / jspsych-psychophysics

A jsPsych plugin for psychophysics
https://kurokida.github.io/jspsych-psychophysics/
MIT License
51 stars 13 forks source link

Coordinate problem about simultaneously using "key" and "button" response type #31

Closed zantee closed 2 years ago

zantee commented 2 years ago

Hi Kurokida! I encounter a problem about precise coordinates when simultaneously using the "key" & "button" response_type. The problem is, although the X&Y positions of my fixation are identical across trials of keyboard and button, the center of my fixation would slightly lift up when the response type was "button", compared with the "key" response type. I don' know why and how to solve the problem (perhaps a bug?). The temporary solution I thought of is creating invisible buttons on fixation trial and all the other trials. But I still want to know how to solve the coordinate problem when using both the "key" and "button" type.

Anyway, jspsych-psychophysics plugin is really a powerful and useful plugin. Thanks for providing such a tool!

kurokida commented 2 years ago

Thank you for your valuable comments. I was not aware of this problem until you pointed it out to me. I know the cause, but it is difficult to solve. I think one solution is to specify the startY property for the fixation point when using "key".

zantee commented 2 years ago

Thank you for the reply. Specifying the startY can be helpful. But I found another really tricky thing, that is, the amount of position drifting would be slightly different when the button choices were different. I am not sure how exactly the value I should send to startY to get rid of the position drifting since the drifting varies from trial to trial according to the button choices.

kurokida commented 2 years ago

Thank you for your reply. Can I see your code?

zantee commented 2 years ago

Sorry for my late reply, cause I was dealing with my experiment coding stuff. Luckily, I have solved this button coordinate problem. I found that the drifting distance between button response-type and key response-type was a function of the font size of the stimuli sent to the button. Moreover, since I used UTF-8 coded Chinese characters materials, the drifting distance also varied with different font families. So, after realizing these two points, and having tried for several times, I found the appropriate drifting distance to add to the startY property. One tip for this problem, I think, is the patience to try :). And it is better to set the drifting distance after you have determined all your stimuli pixel size and font-family, so that you can save a lot of time repeatedly adjusting the drifting distance.

kurokida commented 2 years ago

Thank you for your valuable comments!