Keyboard auto-repeat

Be clear with the topic titles to help members find the answers
Post Reply
User avatar
Martin
Global Admin
Posts: 202
Joined: Mon Jan 02, 2023 5:18 pm

Keyboard auto-repeat

Post by Martin »

OK Chaps a little help please... I have read somewhere (but can't find it now) how to peek and poke the value of the auto-repeat of the key press on the keyboard. I do know the default value is 14 [PEEKB($0077)] but can't remember how to set it to a different value..

I see that page 96 of the LZ Programming manual has..
Technical programming
Memory addresses
These addresses are used for certain system variables. You access them with
PEEKB, PEEKW, POKEB and POKEW. You should only use these commands if
you you know what you are doing.
.....
$0077 ($0E) Delay before keyboard auto-repeat
$0078 ($00) Keyboard auto-repeat counter

Any help would be much appreciated..

Sincerely Martin
MartinP
Posts: 45
Joined: Wed Jan 04, 2023 7:51 pm

Re: Keyboard auto-repeat

Post by MartinP »

Martin,

The keyboard interrupt occurs every 50 ms, this provides the timebase for other timings of the organiser, such as this delay before auto repeat and delay between auto repeats (auto-repeat rate).

This 50 ms between interrupts is sometimes referred to as a 'tick' in the Technical manual. Then the delays can be counted in 'ticks' so for the delay before auto repeat (at $77), the default is 14 ticks, which is 14*50 ms which is 0.7 seconds.

Values can be set using POKEB, for example:
POKEB $78,5
Will set a longer delay between auto-repeats (slower auto-repeat rate), the default is 0 ticks, which will repeat on the next interrupt, so 50 ms. A value of 5 will give 50ms x 5 = 0.25s, but we need to add the initial 50ms, giving 0.3s between repeats.

POKEB $77,5
Will set a shorter delay before auto-repeat starts (default 14 ticks), of 50ms * 5 = 0.25s. (Although maybe there is a minimum 50 ms, like for the auto-repeat rate, so maybe 0.3s)

There is fuller info. on all the system variables on Jaap's site at:
https://www.jaapsch.net/psion/sysvars.htm
Although there are so many there that it's a bit overwhelming at first.
The keyboard interrupt delay is set by the free-running-timer of the processor and can also be changed from the default 50 ms, but it's best to avoid that as it changes a number of other things.

Martin P.
User avatar
Martin
Global Admin
Posts: 202
Joined: Mon Jan 02, 2023 5:18 pm

Keyboard auto-repeat SORTED

Post by Martin »

Thanks martin..
I've got it now... I was trying to 'test' it in the calculator, but it will let you peek but not poke..
It's all sorted in OPL thanks again

Sincerely Martin
Post Reply