Jump to content
  • Advertisement
Sign in to follow this  

MASM: Overriding the typematic rate

This topic is 4089 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
	cmp keyboard.event, keydown
	jne PollKeyBoardNOKEY
	mov keyboard.key, 0
	mov keyboard.event, keyup
	jmp LEAVEPollKeyboard
	mov keyboard.event, nokeypress
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 == " ")
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!

Share this post

Link to post
Share on other sites
Part II to this problem: Is there a way to keep a console window from displaying the cursor? (that annoying _ that blinks)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!