Touching the Screen

Most PLATO terminals have “touch panels” which make it possible for the student to respond by touching the screen. For example, a language drill might show the student pictures of various animals and ask the student to point to the dog. You need a way to tell at which part of the screen the student pointed. This is most easily done with -pause- and -keytype- statements, as in the following example:

pause keys=touch keytype num,touch(1215),touch(100,200)

The first statement, using the built-in group “touch”, tells PLATO to expect a touch input. The -keytype- statement will set “num” to 0, if the student touches as close as possible to screen location “1215”; will set “num” to 1, if the student touches near location “100,200”; and will set “num” to -1, if the student touches the screen elsewhere.

How close the student must be to location “1215” or location “100,200” depends on the resolution or fineness of the touch panel. Most touch panels cover the screen with a 16 by 16 grid of square touch areas. Each square is 32 dots by 32 dots in size, or 4 characters wide by 2 characters high. If the square touched by the student overlaps location “1215” or location “100,200”, TUTOR will consider that the student has pointed at that place.

You can define larger regions of the screen. For example:

keytype num,touch(1215;8,4),touch(100,200;64,32)

In this case, the -keytype- statement will set “num” to 0 if the student touches somewhere within a box whose lower left corner is at “1215”, whose width is 8 characters, and whose height is 4 characters. The variable “num” will be 1 if the student touches within a box whose lower left corner is at fine-grid location “100,200”, whose width is 64 dots, and whose height is 32 dots. The touch-panel square touched by the student must overlap one of your rectangles in order for TUTOR to consider that a rectangle has been touched.

You can abbreviate “touch” by “t” and write “t(1215)” instead of “touch(1215)”.

In addition to the pause-keytype combination, you can also use a -touch- judging command with an -arrow-. See the PLATO on-line “aids” for details.

Summary

In this chapter we have discussed, in some detail, the marker properties of the -arrow- command. The -arrow- command as we have seen serves as an anchor point which TUTOR clings to until the -arrowis satisfied by an “ok” judgment (at which point a search is made for additional -arrow- commands). We looked at some cases involving the repeated execution of -join- in regular, judging, and search states, and of the non-execution of -goto- in the judging and search states. We have also looked at other side-effects of the -arrow- command, including initializations associated with -size-, -rotate-, -long-, -jkey-, and -copy-.

In addition, we have seen how the -bump- and -put- commands can be used to change a student's response into a form more easily handled by the standard judging commands. This is particularly useful when only slight changes are necessary.

In Chapter 7 we saw how to store numeric and alphanumeric responses for later processing (-store- and -storea-). These capabilities make it possible to “do your own judging” in those cases where the standard judging commands are not suitable. The basic TUTOR judging commands provide a great deal of power but cannot handle all possible situations. Fortunately, there is always the possibility of performing calculations on a stored student response, which means that TUTOR is open-ended in its judging power. The regular commands -search- and -move- can be used to manipulate stored character strings. (In Chapter 10 you will find discussions of “segments” and “bit manipulations” which permit you to use the -calc- command to perform additional operations on character strings.) We have also discussed how to handle input from the student by collecting each key with a -pause- command, then using -keytype- (aided by -group-) to make decisions on a key-by-key basis. We have learned, also, how to use similar techniques to determine where the student had touched the screen.