Hi,

If I create a REPeat loop thus:

100 Frame=0 : Keypress=0
110 REPEAT loop
120   a$=INKEY$
130   Frame=Frame+1
140   IF a$<>"" THEN Keypress=Keypress+1
150   AT 0,0 : PRINT Frame, Keypress
160 END REPeat loop

...I reasonably expect that when a key is pressed, the Keypress value
will increase in step with the Frame value (every time the loop
repeats, a keypress is detected) but no. I can type run, and hold down
the enter key, and Frame will increment 55 times for each detected
Keypress. It seems INKEY$ is limited to approx 15 keyboard scans/sec.
On my original QL, with or without GC, they increment together, 1:1.

OK, i'm going out on a limb there.
That's probably because the emulator you use is so much faster.
So the loop gets called much more often, but the keys are only input into the "machine" at "normal" speed (probably every 50th of a second?). Moreover, the QL will probably generate an interrupt for every key pressed, wheres again, the emulator probably will only generate an interrupt every 50th of a second (guessing here).

Wolfgang

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to