www.solvalou.com
Spectrum pages are online for archival purposes only. Visit WoS for more Speccy stuff!

CHAPTER 2 - THE KEYBOARD

>> Next chapter | << Previous chapter | Back to index


The keyboard of the Spectrum is very s imilar to a standard typewriter. The letter and number keys are in the same place; however each key can perform more than one function. On a normal typewriter the letters appear in lower case, and when used in conjunction with the shift key, appear as upper case (capitals). The Spectrum keyboard is just the same.

To help you know what mode the keyboard is in, a reversed out (white on black) letter appears on the screen, indicating the position of the next character that appears when a key is pressed. The letter is flashing to distinguish it from any character already on the screen. It is called the cursor

When first switched on the Spectrum shows a copyright message on the screen. Pressing any key brings up the word printed below the letter on the key, (this is called the keyword). This is because the computer is expecting a command from you to tell it what to do and all commands must begin with a keyword. Unlike most other computers the Spectrum allows you to enter keywords with only one key depression.

For example, if the P key is pressed immediately after turning on, the keyword PRINT appears on the screen The " symbol is marked on the P key as well. To get it, you must press two keys ar once; hold down the SYMBOL SHIFT key, whis is near the bottom right-hand corner of the keyboard, and while still doing that, press the P key.

The cursor now changes to an inversed L, as a letter is now expected by the computer. Type in the letters "Hello". If there is already some other text, for example, on the screen turn the computer off (remove the 9V plug) and start again. Use the CAPS SHIFT key to get the upper case H. In general, anything coloured white above the key requires CAPS SHIFT to access, and anything coloured red on the key requires SYMBOLS SHIFT.

A command beginning with PRINT tells the computer to write the letters enclosed in the double quoter on marks onto the screen. For this command to be executed by the computer, the ENTER key must be used. When this has been done the screen should display the word
Hello
and some other characters. (A flashing question mark indicates a mistake somewhere. If this happens start again and repeat the exercise.) The message at the bottom is really the computer reporting back that everything has gone 'OK'. The message is important when running programs but can be ignored at the moment.

Notice something else: The letter O and the numeral 0 are represented by different characters. It is important to remember this. The numeral 0 always has a line through it. The computer will always interpret the letter O as a letter, so don't press the wrong key. Similarily, the numeral 1 and the lower case letter L are different, and unlike some typewriters, these cannot be interchanged.

As the keyboard mode is so important to understand it is useful to summarise what happtens once again.

The flashing character inversed L is called the cursor. It shows whereabouts on the screen the computer will put the next thing that you type. It is not always an inversed L; if you turn the computer off and on and then press ENTER, the copyright message will change into a inversed K cursor. The letter that it uses tells you how the computer will interpret the next thing that you type. At the beginning of a line, it will be a flashing inversed K standing for 'keyword'. (The copyright message and reports also count as a flashing inversed K). A keyword is one of the computer's special words, occurring at the beginning of a command to give the computer a general idea of what the command is going to tell it to do. Since the computer is expecting a keyword at the beginning of a line, when you press - say - the P key, the computer decides not to interpret this as a P but as PRINT; and it warns you that it is go ing to do this by making the cursor a inversed K. When it has the first keyword, it doesn't expect another one, so what you type now will be interpreted as letters. To show this, the computer changes the cursor to an inversed L - for 'letter'.

These different states are often called modes - we shall talk about keyword (or K) mode, and letter (or L) mode.

If you want to type a lot of capital letters without holding CAPS SHIFT down, you can make all letters come out as capitals by first pressing CAPS LOCK (CAPS SHIFT with 2). To snow this is happening, the inversed L cursor will be replaced by a flashing inversed C (for 'capitals'). To get lower case letters and the inversed L cursor back, press CAPS LOCK a second time.

(If you press CAPS LOCK during keyword mode, you will not immediately notice any difference, but you will see the effect after entering the keyword when the computer will be in C mode instead of L mode).

As well as keywords, letters, numbers and various programming and scientific expressions, the keyboard also has eight graphics characters. These appear on the number keys 1 to 8, and can be printed onto the screen in a similar way to letters and numbers. To do this the keyboard must be changed to graphics mode. This is done by pressing the CAPS SHIFT key with the 9. Notice the cursor change to a inversed G. Pressing the 9 key will change back to L mode.

There is one last mode that the keyboard can be changed to. The extended mode, indicated by an inversed E cursor, is obtained by pressing CAPS SHIFT and SYMBOL SHIFT at the same time. This allows most of the scientific and programming functions to be used. Pressing the two SHIFT keys again will revert the keyboard back to letter, L, mode.

Even if you are the most proficient typist, or programmer, wrong keys get pressed. So far the only way to overcome this has been to pull the plug out! Although this may be convenient if only one command has been given to the computer, it is certainly very inconvenient if a lot of information has already been entered.

Luckily we can use the DELETE key to change errors. For example, not much can go wrong with the simple command:
PRINT "Hello"
... or can it?

Let's assume that you didn't use the SYMBOL SHIFT key to get the opening quotes. The screen would show
PRINT PHello"
The computer would not have recognised what came after PRINT as no quotes indicates to the ZX Spectrum that a number is expected - and it found a letter instead. It shows its confusion by flashing a inversed question mark at the end of the line.

Fortunately you don't have to type it all out again. On the top row of the keyboard are four arrows pointing in different directions and the word DELETE. To operate these keys, you have to use the CAPS SHIFT key when you press them. The sideways arrows move the cursor to the left or the right, and the DELETE key rubs out the character immediately before the cursor.

To correct your nonsense line, press left arrow(CAPS SHIFT and 5 at the same time) until the cursor is just after the P that you put in by mistake - if you hold them down for a second or two, then they wil start working continuously, emitting a quiet clicking sound. In fact if you keep your finger on any key for more than about three seconds it automatically repeats itself. Key in DELETE (CAPS SHIFT and 0) to delete the wrong P, and then type " (SYMBOL SHIFT and P) to insert what should have been there - note that it is inserted without overwriting anything else. Try the cursor right key as well, just to get the hang of it. If you made any genuine typing mistakes, correct them in the same way, remembering that you can't overwrite mistakes; you have to delete them and then insert the corrections.

Now, when you press ENTER, the computer will write your message at the top of the screen - or underneath the one it did the first time, if that is still there.

A full description of the keyboard can be found in Chapter 1 of the BASIC programming manual.

----------
Conquest is easy. Control is not.
  -- Kirk, "Mirror, Mirror", stardate unknown