A86: Re: Reading keypresses


[Prev][Next][Index][Thread]

A86: Re: Reading keypresses




have a 'flag' that you put 1 after the port reading is successful for the
2nd key being pushed. add a routine right after the check for the 2nd key so
that if the flag is 1 it exits so it doesnt fire again. then add code that
if the 2nd key wasn't pushed it changes it to a 0. this will make it appear
that the key is pressed and then it wont fire til it is released and pressed
again.

>I'm having trouble getting keys read correctly in a space invaders game I'm
>making.  I read the arrow keys in (currently using ports) and also need 2nd
>for fire and others like exit.  I want the fire key to have to be pressed
>for every shot but the arrows to be held.  Calling getkey to check 2nd
>works, but you must let up and re-press left/right.  I read some other
>source, but can't find anything exactly like this.  Any ideas?