MASM: Overriding the typematic rate

Started by
0 comments, last by argonaut 16 years, 6 months ago
This probably belongs in the beginner section, but since it's assembly I thought I would have better luck posting here.

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

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!
~Argonaut________________________________Why "~Argonaut"? It's all just a mathematical expression denoting a close approximation of "Argonaut", which is irrational and can't be precisely defined.
Advertisement
Part II to this problem: Is there a way to keep a console window from displaying the cursor? (that annoying _ that blinks)
~Argonaut________________________________Why "~Argonaut"? It's all just a mathematical expression denoting a close approximation of "Argonaut", which is irrational and can't be precisely defined.

This topic is closed to new replies.

Advertisement