mIRC Homepage
Posted By: R2O $keyrpt ...problem? - 25/06/04 12:48 PM
I have a ...strange problem. I am making a game in mIRC with picture windows and I use $keyrpt to check if a button is repeating. But... When the user presses another key (when the first key is still pressed down) then $keyrpt (for the first key) is interupted and returns $false. (After all this is the logical thing to do smirk ) Here is my problem: Is there anyway to set $keyrpt again to $true ? Because the key that fired up $keyrpt is still pressed... I use on keydown a lot to check the keys and I understand that the answer I am looking for is against the ...proper use of $keyrpt.

Thank you in advance grin

Well there is the obvious solution... Let go the first key and press it again so $keyrpt for that key is $true again... But as I said in the main post this key is pressed down all the time and it gets frustrating to lift your finger and press again.
Posted By: Cobra Re: $keyrpt ...problem? - 26/06/04 01:31 PM
there is no solution i can think of

all i know is that no aplication that i know of works like that .. even in windows if u openup notepad or any other text editor .. and hold down one leter, then hit any other leter while still holding down the first ... the first one stops and does not start again unless you unpress and repress the key

and beings mIRC is probably (i'm guessing, i dont know for sure) geting its information from windows, and windows works that way ...

the solution is to change the way your game works .. because no other game i know of work that way either .. so how do they do it ?

if there is a solution .. it probably involves useing a dll or something .. but i dont know it

sorry i wasnt more help,

Cobra^
Posted By: R2O Re: $keyrpt ...problem? - 26/06/04 02:34 PM
Yes you are right. And thank you smirk
Posted By: Darwin_Koala Re: $keyrpt ...problem? - 27/06/04 12:21 AM
OK, I will caveat this by saying that I am not an expert in this sort of coding, and even less so by using Java.

However, I understand that Java allows for the events of KeyPressed, Key Typed and KeyReleased. Thus, the coding may want to look for key-release as the main event?

I think the answer would depend on what language you use for coding the input in - perhaps your own DLL?

Cheers,
DK
© mIRC Discussion Forums