Jump to content

Keystroke programming

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ldo (talk | contribs) at 11:07, 23 May 2011 (continue example). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Keystroke programming describes a specific way of programming by which each keystrokes on a device or application is recorded in some way and then played back so that the recorded key-presses can be repeated multiple times. Keystroke programming is most commonly but not exclusively found in programmable calculators, but there are keystroke-programmable software applications, too, for example Vim (text editor)[1]

Example: TI Calculators

The Texas Instruments TI-58/58C/59 calculators were programmable, and program storage took the form of a sequence of codes which (mostly) corresponded to the position of keys on the calculator keypad. Here is a simplified diagram of the basic key layout:

  x1 x2 x3 x4 x5
1x  A   B   C   D   E 
2x 2nd INV lnx CE CLR
3x LRN x⇌t √x 1/x
4x SST STO RCL SUM yx
5x BST EE  (   )   ÷ 
6x GTO  7   8   9   × 
7x SBR  4   5   6   - 
8x RST  1   2   3   + 
9x R/S  0   .  +/-  = 

Each key is assigned a two-digit code; for most (but not all) keys, the tens digit comes from the row number (as indicated down the left of the table) and the units digit comes from the column number (as indicated across the top of the table).

Now consider a very simple program, which adds 2 to the number being displayed, and then stops. The program is entered starting from program location 000, and looks like this:

Location Contents Meaning Comments
000 85 +
001 02 2
002 95 = compute result
003 91 R/S stop program

You can see that the codes 85, 95 and 91 correspond to the positions of the keys labelled  + ,  =  and R/S on the grid above, but the code for the  2  is not 83 as you would expect from the grid position, but 02. This last code is chosen to be more easily understandable by a human trying to read the program. There is no row 0, so the codes 00 .. 09 are used to represent the keys  0  ..  9 .

Ind

TBD more to come

References