Sign in to follow this  

MASM: Overriding the typematic rate

This topic is 3728 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

This topic is 3728 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this