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.
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.
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 joystick3 (if n is 0).
In each case, the value returned is a bitmask of the following value:
| bit 0 (value 1) | right pressed |
| bit 1 (value 2) | left pressed |
| bit 2 (value 4) | down pressed |
| bit 3 (value 8) | up pressed |
| bit 4 (value 16) | fire pressed |
3 NextZXOS has a feature where the keyboard can emulate one of the joystick standards it normally supports
ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.