Package | Class | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class ScanningKeyboardSPC

    java.lang.Object
      ScanningKeyboardSPC

    public class ScanningKeyboardSPC

extends java.lang.Object

# ScanningKeyboardSPC

### Summary

- Compute the SPC (scan steps per character) for a scanning keyboard.

- Scanning keyboards are commonly used in accessible computing. Input uses a single key or switch.

- Definition of SPC: the average number of scan steps required to generate a character of text in a given language using a given scanning keyboard.

- SPC is the same as KSPC (keystrokes per character), except that the calculation uses scan steps, rather than keystrokes. In both cases, each word is assumed to end with a terminating SPACE character.

### Related references

- MacKenzie, I. S. (2012). Modeling text input for single-switch scanning. Proceedings of the 13th International Conference on Computers Helping People with Special Needs - ICCHP 2012, 423-430. Berlin: Springer.

- MacKenzie, I. S. (2002). KSPC (keystrokes per character) as a characteristic of text entry techniques. Proceedings of the Fourth International Symposium on Human Computer Interaction with Mobile Devices, pp. 195-210. Heidelberg, Germany: Springer-Verlag.

- Koester, H. H., & Levine, S. P. (1994). Learning and performance of able-bodied individuals using scanning systems with and without word prediction. Assistive Technology, 6, 42-53.

### Details

The following usage message appears if the program is launched without arguments:

         java ScanningKeyboardSPC file -ak|-kk|ck... [-wfs] [kl] [-spc] [-wp] [-hh]

         where file = word-frequency dictionary file
               -ak = alpha keyboard layout (_abcde-fghijk-lmnopq-rstuvw-xyz...)
               -kk = Koester-Levine keyboard layout (_eardu-tnsfwb-ohcpvj-imkkq.-lgxz..)
               -ck... = custom keyboard layout (e.g., -ck_ABCD-EFGHI-KLMNO-PQRST-WXYZ~)
               -wfs = output word-freq-scans
               -kl = output keyboard layout
               -spc = output Scan Steps Per Characters statistic
               -wp = word predict (use "W" (uppercase) in layout to indicate column)
               -hh = assume half-and-half scanning for word prediction

The first argument is a word-frequency dictionary. This is a reduced version of the language corpus used for the analysis. For the analyses in the first reference above, three such word-frequency files were used: d1-wordfreq.txt, d2-wordfreq.txt, bc-wordfreq.txt, and phrases2-wordfreq.txt. Consult the first reference above for details on the original corpora.

Optional arguments appear next.

The `-ak` and `-kk` options are used for two layouts that are hard-coded in the application. These are an alphabetic layout (`-ak` option) and an optimized layout proposed in the Koester and Levine reference (`-kk` option). See below.

          ALPHABETIC      KOESTER-LEVINE
          ===========     ===========
          _ a b c d e     _ e a r d u
          f g h i j k     t n s f w b
          l m n o p q     o h c p v j
          r s t u v w     i m y k q .
          x y z . . .     l g x z . .

An underscore ("`_`") represents the SPACE character. Periods (".") are unassigned keys.

The `-ck` option is used to specify a custom layout. A dash is used as a row separator. There must be an equal number of characters per row. Use lowercase letters. See example invocations below.

There are three output options:

- `-wfs` – output the word-frequency list; each line is appended with the coded scan steps for the word

- `-kl` – output the keyboard layout

- `-spc` – output the computed scan steps per character (SPC)

The `-wp` option is for word prediction. This option is used for keyboards that include a dedicated column for words. The word entries are identified by W (uppercase) in the column where the words appear. Words are predicted from the current word stem and are assumed to populate the word list after each character entered. Words are sorted by their probability in the word-frequency file. The computation of SPC will consider the contents of this list for optimal input (i.e., lowest SPC).

The `-hh` option is for "half-and-half scanning", as proposed by Koester and Levine. This option only applies if the `-wp` option is also used. Half-and-half-scanning is used to speed-up entry with word prediction. Scanning initially alternates between the letter-region and the word-region of the keyboard. The user first selects in the desired region, then selects within the letter or word region of the keyboard. Within the letter region, conventional row-column scanning is used.

### Example invocations

         PROMPT>java ScanningKeyboardSPC d1-wordfreq.txt -ak -spc -kl
         Scanning keyboard layout...
            _ a b c d e
            f g h i j k
            l m n o p q
            r s t u v w
            x y z . . .
         WordFreqFile=d1-wordfreq.txt, SPC = 5.19

         PROMPT>java ScanningKeyboardSPC d1-wordfreq.txt -kk -spc -kl
         Scanning keyboard layout...
            _ e a r d u
            t n s f w b
            o h c p v j
            i m y k q .
            l g x z . .
         WordFreqFile=d1-wordfreq.txt, SPC = 4.28

         PROMPT>java ScanningKeyboardSPC d1-wordfreq.txt -kk -wfs
         the 5776384 .Rt..R.hR.eR_
         of 2789403 ..Ro.R...fR_
         and 2421302 R..a.R.nR....dR_
         a 1939617 R..aR_
         in 1695860 ...Ri.R.nR_
         to 1468146 .Rt..RoR_
         is 892937 ...Ri.R..sR_
         ...

         PROMPT>java ScanningKeyboardSPC d1-wordfreq.txt -ck_abcd-efghi-jklmn-opqrs-tuvwx-yz... -kl -spc
         Keyboard layout...
            _ a b c d
            e f g h i
            j k l m n
            o p q r s
            t u v w x
            y z . . .
         WordFreqFile=d1-wordfreq.txt, SPC = 5.14

         PROMPT>java ScanningKeyboardSPC d1-wordfreq.txt -ck_earduW-tnsfwbW-ohcpvjW-imykq.W-lgxz..W-......W -kl -spc -wp
         Keyboard layout...
            _ e a r d u W
            t n s f w b W
            o h c p v j W
            i m y k q . W
            l g x z . . W
            . . . . . . W
         WordFreqFile=d1-wordfreq.txt, SPC= 3.35

         PROMPT>java ScanningKeyboardSPC d1-wordfreq.txt -ck_earduW-tnsfwbW-ohcpvjW-imykq.W-lgxz..W-......W -kl -spc -wp -hh
         Keyboard layout...
            _ e a r d u W
            t n s f w b W
            o h c p v j W
            i m y k q . W
            l g x z . . W
            . . . . . . W
         WordFreqFile=d1-wordfreq.txt, SPC= 2.73

The last two invocations are examples with word prediction. The word prediction list is included as an extra column in the layout. Uppercase `W` indicates the column. As proposed by Koester and Levine, there are six words in the list, so an extra row is added. Note the reduced SPC with half-and-half scanning, from SPC = 3.35 to SPC = 2.73.

Obviously, the command-line arguments are long and complicated when doing analyses on keyboards with custom layouts. One approach is to organize the analyses in a batch file. As an example, the batch file ScanningKeyboardSPC.bat was used to generate the analyses used in the MacKenzie ICCHP 2012 paper.

A separate application called `WordPredict` is available to view the word prediction lists, if desired.

Author:
  Scott MacKenzie, 2009-2015

Constructor Summary
`ScanningKeyboardSPC()`

Method Summary
`static int` | `getColumnIndex(char[][] keyboardArg, char cArg)`
`static int` | `getRowIndex(char[][] keyboardArg, char cArg)`
`static java.lang.String` | `getScans(char[][] keyboardArg, java.lang.String wordArg, WordPredict wpArg, boolean hhOptionArg)`
`static void` | `main(java.lang.String[] args)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ScanningKeyboardSPC

    public ScanningKeyboardSPC()

Method Detail

### main

    public static void main(java.lang.String[] args)
                     throws java.io.IOException

  Throws:
    `java.io.IOException`

### getRowIndex

    public static int getRowIndex(char[][] keyboardArg,
                                  char cArg)

### getColumnIndex

    public static int getColumnIndex(char[][] keyboardArg,
                                     char cArg)

### getScans

    public static java.lang.String getScans(char[][] keyboardArg,
                                            java.lang.String wordArg,
                                            WordPredict wpArg,
                                            boolean hhOptionArg)

Package | Class | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD