PollKeyboard PROC
call ReadKey
mov keyboard.key, al
jz PollKeyBoardKEYUP
mov keyboard.event, keydown
jmp LEAVEPollKeyboard
PollKeyboardKEYUP:
cmp keyboard.event, keydown
jne PollKeyBoardNOKEY
mov keyboard.key, 0
mov keyboard.event, keyup
jmp LEAVEPollKeyboard
PollKeyBoardNOKEY:
mov keyboard.event, nokeypress
LEAVEPollKeyboard:
ret
PollKeyboard ENDP
ProcessInput PROC
.IF (keyboard.key == "a")
dec player.object.pos.x
.ELSEIF (keyboard.key == "w")
dec player.object.pos.y
.ELSEIF (keyboard.key == "s")
inc player.object.pos.y
.ELSEIF (keyboard.key == "d")
inc player.object.pos.x
.ELSEIF (keyboard.key == " ")
.ENDIF
ret
ProcessInput ENDP
MASM: Overriding the typematic rate
This probably belongs in the beginner section, but since it's assembly I thought I would have better luck posting here.
My question is: Is there a way to override the Window's typematic rate? Or, is there a better way to do what I'm trying to do? Basically, I don't want that 1/10 of a second delay.
I'm guessing the problem is in the ReadKey call, which is part of Kip Irvine's library.
Thanks all!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement