<!-- PDF page 93 -->

```
POKE 23692,x
```

where **x** is the amount of lines the scroll prompt should be inhibited for –or in other words, *every time the scroll counter has been reached*. After this it will scroll up x number of times before stopping again with **scroll?**. As an example, try:

```
10 POKE 23692, 255
20 FOR n=1 TO 400
30 PRINT "line ";n
40 NEXT n
```

and watch everything whizz off the screen up until line 277 before the prompt to scroll reappears! The technical explanation of what this **POKE** does, is that it modifies the *System Variable* **SCR CT**. It's important to also note that the Editor resets this *System Variable* so entering the **POKE** directly will have no appreciable effect on scrolling on *Layer 0* until it's entered in a program. We will examine all the possible combinations of **PRINT** *control codes* on *Chapter 21*. You will find more information about *System Variables* in *Chapter 24* and for **POKE** in *Chapter 23 – The Memory*.

### INKEY$

There's an additional function related to keyboard entry called **INKEY$**. **INKEY$** (which takes no argument) reads the keyboard immediately when it's invoked. If you are pressing exactly one key (or a **SHIFT** key and just *one* other key) then the result is the character that that key gives in that typing mode; otherwise the result is the empty string.

Try this program, which works like a typewriter.

```
10 IF INKEY$ <>"" THEN GO TO 10
20 IF INKEY$ = "" THEN GO TO 20
30 PRINT INKEY$;
40 GO TO 10
```

Here line **10** waits for you to lift your finger off the keyboard and line **20** waits for you to press a new key.

Unlike the regular **INPUT** (see also the next section), **INKEY$** doesn't wait for you. So you don't type **ENTER**, but on the other hand if you don't type anything at all then you've missed your chance. This also explains why the **GO TO** statements are needed in lines **10** and **20**.

### Using INPUT for game controllers

Much like **INKEY$** above, **INPUT** can also be used as a function with a numeric parameter *n* in order to read the current state of an input controller.

```
INPUT n
```

reads the current state of an input controller which can be one of the two joysticks (If *n* is 1 or **2**) or the *keyboard joystick*[^p93-3] (if *n* is **0**).

In each case, the value returned is a bitmask of the following value:

<table>
<tbody>
<tr><td>bit <strong>0</strong> (value <strong>1</strong>)</td><td><em>right</em> pressed</td></tr>
<tr><td>bit <strong>1</strong> (value <strong>2</strong>)</td><td><em>left</em> pressed</td></tr>
<tr><td>bit <strong>2</strong> (value <strong>4</strong>)</td><td><em>down</em> pressed</td></tr>
<tr><td>bit <strong>3</strong> (value <strong>8</strong>)</td><td><em>up</em> pressed</td></tr>
<tr><td>bit <strong>4</strong> (value <strong>16</strong>)</td><td><em>fire</em> pressed</td></tr>
</tbody>
</table>

[^p93-3]: NextZXOS has a feature where the keyboard can emulate one of the joystick standards it normally supports

