Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label...

12
script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ] 5. Feedback on screen 8. Waiting for multiple events DefineTabZone WaitForTabZones ClearZones 10-12 April 2012, Mshs, University of Poitiers, France Hands on scripts…

Transcript of Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label...

Page 1: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

script commands (2)

SetPencolorSaveScreenToBmp [ V2 ]

6. Eyetracker controlTestDrift

7. JumpLabelJumpToJumpToIfLabelIs

9. keywords%I%%S% [ V2 ]

5. Feedback on screen 8. Waiting for multiple eventsDefineTabZoneWaitForTabZonesClearZones

10-12 April 2012, Mshs, University of Poitiers, France

Hands on scripts…

Page 2: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

5. Feedback on screen

5.1. SetPenColor(ColorValue)

Set the color of the trace leaved by the pen on screen. Replace ColorValue with a color number (Internet standard) between #000000 (black) and #FFFFFF (white).

Example: SetPenColor(#0000FF) will have the pen to write in blue on screen.

Example of use: have a participant to correct a document with a red “ink”.

Figure: Command | Display | SetPenColor dialog box10-12 April 2012, Mshs, University of Poitiers, France

Page 3: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

The picture is saved in the Stimuli folder, enabling to use it later as a stimuli.

5.2. SaveScreenToBmp(PictureFileName) [ Eye and Pen 2 ]

Saves the content of the screen into a BMP format picture file. Replace PictureFileName with a name for the file.

Example: SaveScreenToBmp(FirstPage.bmp)

Example of use: have a participant to correct its own production at a later time.

10-12 April 2012, Mshs, University of Poitiers, France

Page 4: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

6. Eyetracker control

6.1. TestDrift

Pauses the script and launches the eye tracker coordinates drift test procedure, if any.

Eye trackers behaves differently: Eyelink: the test is run with a single point. EyePuter: the entire calibration procedure is repeated. For EyePuter, you

can also choose to test just one point. ASL504: the entire calibration procedure is repeated.

10-12 April 2012, Mshs, University of Poitiers, France

Page 5: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

7. Jumps

7.1. Label

Identifies a particular place in the script to which you will later refer to.It is the point where the script interpretor will return each time the sequence of commands is to be repeated. Example: :Anchor1

Telling the script interpretor to continue reading script from an other line.

Reminder: a label has an internal counter that counts the number of times the scripts interpretor read it.

The script interpretor has a memory of the value of the last label counter he “passed by”.

10-12 April 2012, Mshs, University of Poitiers, France

; Fill the ilst will 16 numbers (from 1 to 16):Iteration

AddToList(%I%) JumpToIfNumberIs(Next,16,FALSE) JumpTo(Iteration,FALSE)

:Next

Iteration

4

Next

1

4

1

Page 6: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

7.2. JumpTo(Label,MustCloseRec)

This command has the script interpretor to “go to” a label.

Replace Label with the name of the label to go to. Replace MustCloseRec with TRUE if an acquisition data file should be closed before “jumping” to the label.

Example: JumpTo(Start,FALSE)

10-12 April 2012, Mshs, University of Poitiers, France

:Start

… some commands …

JumpTo(Next)

… other commands …

:Next

… more commands …

Script interpretor will read and execute:

some commands

JumpTo(Next)

more commands

Page 7: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

7.3. JumpToIfLabelIs(DestLabel,LabelToCheck,Iterations,MustCloseRec)

This command has the script interpretor to “go to” the label DestLabel if a condition is met: the label LabelToCheck counter’s value is equal to a given value.

10-12 April 2012, Mshs, University of Poitiers, France

Example: JumpToIfLabelIs(Start,Next,3,FALSE)

Translation: go to the label named “Start” if the counter’s value of the label “Next” is 3.

Replace iterations with the required value. Replace DestLabel with the name of the label to go to. Replace LabelToCheck with the name of the label to watch. Replace MustCloseRec with TRUE if an acquisition data file should be closed before “jumping” to the label.

1

… commands…

:Start

… other commands …

JumpToIfLabelIs(Next,Start,3,FALSE) jumpto(Start) :Next

First “pass”Second “pass”Third “pass”23

Page 8: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

7.4. Script editor tries to help

In script editor dialog boxes, right-clicking on fields requiring a label name shows a list of existing script labels and keywords.

10-12 April 2012, Mshs, University of Poitiers, France

Page 9: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

8. Waiting for multiple events

8.1. DefineTabZone(x1,y1,x2,y2,Label)

Associates a zone on the tablet with a label in script.

Replace X1,y1,x2,y2 with the tablet coordinates of the new zone to consider.

Replace Label with the name of the label associated with the new “trigger” (zone).

More than one tablet zone can be defined on the tablet, and each one can trigger an action.

8.2. WaitForTabZones

Stops script execution until the pentip is pressed into one of the zones defined with “DefineTabZone”.

The selection of a zone has the script interpretor to “go to” the label associated with the selected zone.

This will act as a “JumpTo(Label)” instruction for the script interpretor .

10-12 April 2012, Mshs, University of Poitiers, France

8.3. ClearZones

Removes all previously defined zones.

Page 10: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

9. Keywords

9.1. %I%Retrieves the value of the last label counter’s value read by the script interpretor (remember: script interpretor has a memory for this).

9.2. %S% [ Eye and Pen 2 ]

This keyword will be replaced with the participant’s Id.

Keywords are special symbols, replaced with values fixed (calculated) when script is “run”.

10-12 April 2012, Mshs, University of Poitiers, France

Page 11: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

Exercise 3

Write a script such that a participant writes a page, then press the pen in a zone each time he starts a new page.

DefineTabZone(35734,4,44697,10325,OneMorePage)

DefineTabZone(35949,21193,44697,27932,Finished)

:OneMorePage

DisplayPic(GreyBkgnd.bmp,-1,-1,-1)

OpenRec(_page%I%)

WaitForTabZones(TRUE,TRUE,TRUE)

:Finished

DisplayMsg(Thanks !,3000,-1,-1,TRUE)

Hands on scripts !

10-12 April 2012, Mshs, University of Poitiers, France

Page 12: Script commands (2) SetPencolor SaveScreenToBmp [ V2 ] 6. Eyetracker control TestDrift 7. Jump Label JumpTo JumpToIfLabelIs 9. keywords %I% %S% [ V2 ]

Exercise 4

Write a script such that a participant writes a text, reads an instruction to look for spelling errors and corrects its own text in red ink.

; Pen color: blackSetPenColor(#000000)DisplayPic(GreyBkgnd.bmp,-1,-1,-1)OpenRec(_text)WaitForTabZoneAt(35725,20987,44697,27932,TRUE,TRUE)CloseRecSaveScreenToBmp(%S%_text)DisplayPic(instructions.bmp,-1,-1,-1)WaitForKeyPress; Pen color: redSetPenColor(#FF0000)DisplayPic(%S%_Text.bmp,-1,-1,-1)OpenRec(_Correct)WaitForTabZoneAt(35725,20987,44697,27932,TRUE,TRUE)CloseRecHidePictureDisplayMsg(Thanks !,3000,-1,-1,TRUE)

10-12 April 2012, Mshs, University of Poitiers, France