Difference between revisions of "83Plus:RAM:8442"
From WikiTI
m (→Synopsis) |
(Edited name to be prettier. keyHook as opposed to KeyHook) |
||
Line 1: | Line 1: | ||
− | [[Category:83Plus:RAM:By Address|8442 - | + | [[Category:83Plus:RAM:By Address|8442 - keyDelay]] |
− | [[Category:83Plus:RAM:By Name| | + | [[Category:83Plus:RAM:By Name|keyDelay]] |
== Synopsis == | == Synopsis == | ||
− | '''Unofficial Name:''' | + | '''Unofficial Name:''' keyDelay |
'''Memory Address:''' 8442h | '''Memory Address:''' 8442h | ||
Line 26: | Line 26: | ||
.db 83h | .db 83h | ||
ld b,a | ld b,a | ||
− | ld hl,8442h | + | ld hl,8442h ;keyDelay |
ld a,(hl) | ld a,(hl) | ||
cp 32h | cp 32h |
Latest revision as of 06:50, 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 ;keyDelay 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.