Difference between revisions of "83Plus:RAM:8442"
From WikiTI
(Used by the OS to check for key delays and repeats.) |
m (→Synopsis) |
||
Line 10: | Line 10: | ||
'''Length:''' 1 byte | '''Length:''' 1 byte | ||
− | This byte of RAM handles the delay between key presses. It is at 50 (or 32h) until | + | This byte of RAM handles the delay between key presses. It is at 50 (or 32h) until a key is pressed. It then counts down to 0 while the key is being pressed. If the key is a repeating key (del or the arrows), it resets to 10 and then counts back down. |
If used in a hook, you can modify the repeating speeds of keys as well as make all keys repeat. | If used in a hook, you can modify the repeating speeds of keys as well as make all keys repeat. | ||
+ | |||
== Examples == | == Examples == | ||
Revision as of 06:44, 28 April 2011
Synopsis
Unofficial Name: KeyDelay
Memory Address: 8442h
Length: 1 byte
This byte of RAM handles the delay between key presses. It is at 50 (or 32h) until a key is pressed. It then counts down to 0 while the key is being pressed. If the key is a repeating key (del or the arrows), it resets to 10 and then counts back down.
If used in a hook, you can modify the repeating speeds of keys as well as make all keys repeat.
Examples
Change Delay Speed
The following code will change the delay and repeat speed of keys. 'Delay' and 'Repeat' need to be defined.
SetKeyHook: in a,(6) ;To obtain the page the hook is on (if it is on the same page) ld hl,KeyHook B_CALL _EnableRawKeyHook ret KeyHook: .db 83h ld b,a ld hl,8442h ld a,(hl) cp 32h jr c,NotDelay ld a,Delay ;Change this to a number less than 50 to change the initial delay ld (hl),a ld a,b ret NotDelay: cp 0Ah jr nz,NotRepeat ld a,Repeat ;Change this to a number less than 10 to change the repeat speed ld (hl),a NotRepeat ld a,b ret
Comments
There are several bytes following and preceding this that are similar.