What is scancode for mouse response?


Author
Message
ymin1123
ymin1123
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 14, Visits: 80
Original script from inquisit used keyboard as an input device, and I'm trying to change input device to mouse. Scancode for space key was 57, but I can't find any scancode for mouse left button.
I tried 84 and 85, but it didn't worked. 
Following is part of the original script (Go-nogo task), and it's coding correct response using scan code (0=noresponse, 57=space bar).
How can I code 'left mouse down' with a number?


<list correctresp>
/ items = (
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,

0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57,
0,0,0,0,57)
/ selectionmode = list.soa.currentindex
</list>

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
There are no numerical scancodes for mouse events. What you are looking for is lbuttondown, as detailed in the documentation for the valdiresponse attribute.

ymin1123
ymin1123
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 14, Visits: 80
Thanks for your reply!
I tried to add some text to code 'lbuttondown' for response.
Original script defines correct response with '0(no response)' and '57 (space bar)'.
If input and predefined correct response are identical , the input is marked as a correct answer.
I added underlined text to shift 'noresponse' into 0 (same as original script) , and 'lbuttondown response' into '57' and assigned them using a new value (respreal).
I ran the script, but values.respreal from data file is '0' all the time (in every trial)!
How can I fix this?
I want to assign 'lbuttondown' as '57' in values.respreal, and 'noresponse' as '0' in values.respreal.
I attached inquisit script file that I modified.

**************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************
Correct Responses (57=spacebar on go trials, 0=no response on no-go trials)
**************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************
<list correctresp>
/ items = (
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0)

<trial target>
/ ontrialbegin = [if (values.correctresp != 0) values.count_go += 1 else values.count_nogo += 1]
/ stimulustimes = [0=target]
/ inputdevice = mousekey
/ validresponse = (lbuttondown, noresponse)
/ ontrialend = [if(trial.target.response=="lbuttondown") {values.respreal=57}]
/ ontrialend = [if(trial.target.response== 0) {values.respreal= 0}]

/ iscorrectresponse = [values.respreal==values.correctresp]



Attachments
audio_GoNogo_test_07_test6.iqx (794 views, 32.00 KB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
/ontrialend attributes are executed *after* response evaluation.

You need to fold the logic into the /iscorrectresponse attribute.

ymin1123
ymin1123
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 14, Visits: 80
Thanks for reply.
I modified script as you suggested (underlined text), and I fount one problem.
I want to mark response as correct answer if
1) response is 'lbuttondown' &&  values.correctresp == 57
or
2) response is '0 (no response)' &&  values.correctresp == 0
but...inquisit marked response 'correct' when response==0 && values.correctresp ==57 (which should be marked 'wrong').
Is there anything wrong with my logic on script?

**************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************
Correct Responses (57=spacebar on go trials, 0=no response on no-go trials)
**************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************
<list correctresp>
/ items = (
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0,
57,57,57,57,0)
<trial target>
/ ontrialbegin = [if (values.correctresp != 0) values.count_go += 1 else values.count_nogo += 1]
/ stimulustimes = [0=target]
/ inputdevice = mousekey
/ validresponse = (lbuttondown, noresponse)
/ iscorrectresponse = [(trial.target.response=="lbuttondown" && values.correctresp==57) || (trial.target.response== 0 && values.correctresp== 0)]




Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
When / where do you set values.correctresp?

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 108K
FWIW, there's a minor syntax issue in your /iscorrectresponse attribute. It ought to read

/ iscorrectresponse = [(trial.target.response=="lbuttondown" && values.correctresp==57) || (trial.target.response=="0"&& values.correctresp== 0)]
Edited 11 Years Ago by Dave
ymin1123
ymin1123
Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)Expert (1.2K reputation)
Group: Forum Members
Posts: 14, Visits: 80
Thanks a lot!
Problem solved!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search