07-30-2003, 05:45 AM
Okay, i figured out the problem.
See, INP returns a number below 128 when a key is pressed, and it returns a value that's corresponds with (the key press + 128) when that key is unpressed.
Arrow keys are an exception though; When you press them, they return a unique value, but when you un-press them, all four return the same value of 170 - which does not correspond with the keypress. I needed to add this fixer for that:
Of course, if I needed to have the user press the left and right arrow keys (75 and 77) at the same time, then I guess I'd have some problems. Fortunately I don't need that.
Sorry if I didn't really explain this very well, but I guess it's irrelevant because nobody else had my problem :bounce:
Thanks to everyone who helped me out!
See, INP returns a number below 128 when a key is pressed, and it returns a value that's corresponds with (the key press + 128) when that key is unpressed.
Arrow keys are an exception though; When you press them, they return a unique value, but when you un-press them, all four return the same value of 170 - which does not correspond with the keypress. I needed to add this fixer for that:
Code:
FUNCTION Multikey (keynum)
KeyInp = INP(96)
IF KeyInp <= 127 THEN
KeyInput(KeyInp) = 1
END IF
IF KeyInp >= 128 THEN
KeyInput(KeyInp - 128) = 0
IF KeyInp = 170 THEN ' Arrowkeys are an exception
KeyInput(75) = 0
KeyInput(77) = 0
END IF
END IF
Multikey = KeyInput(keynum)
END FUNCTION
Of course, if I needed to have the user press the left and right arrow keys (75 and 77) at the same time, then I guess I'd have some problems. Fortunately I don't need that.
Sorry if I didn't really explain this very well, but I guess it's irrelevant because nobody else had my problem :bounce:
Thanks to everyone who helped me out!
img]http://b.domaindlx.com/cygh/mycophob3.gif[/img]