Jump to content
  • Advertisement
Sign in to follow this  
argonaut

MASM: Overriding the typematic rate

This topic is 4011 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
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!

Share this post


Link to post
Share on other sites
Advertisement
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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!