samsung d500 getKeyStates(); problem
lruckhaber <[email protected]> Wed, 12 Nov 2008 19:12:13 +0100
| Newsgroups | gmane.comp.java.sun.kvm |
|---|---|
| Message-ID | <6351E2B43FE54729A05F5840B2BAC3F8@amobile> |
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C944FA.91AC7100
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
hi
when iam use in gamecanvas=20
private boolean input()=20
{
=20
int keyStates=3DgetKeyStates();
=20
if((keyStates & FIRE_PRESSED) !=3D 0)
{
fire_func();
} =20
but if iam pressed softkey then its interpreted as FIRE .
public void keyPressed(int keyCode)
{
int keyCodeOrg=3DkeyCode;
System.out.println(keyCodeOrg);
}
public void run()=20
{
while(gameRunning) //is true =20
{
long l1 =3D System.currentTimeMillis();
input();
while(System.currentTimeMillis()- l1<THREAD_WAIT);
}
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".
------=_NextPart_000_0008_01C944FA.91AC7100
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16735" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>when iam use in gamecanvas =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> private boolean =
input()=20
<BR> =20
{<BR> <BR> &nbs=
p; int =20
keyStates=3DgetKeyStates();<BR> </FONT><FONT face=3DArial=20
size=3D2> <BR></FONT><FONT face=3DArial=20
size=3D2> &nbs=
p;=20
if((keyStates & FIRE_PRESSED) !=3D =
0)<BR> {</FONT></DIV>
<DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p;=20
fire_func();</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>} =20
</FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>but if iam pressed softkey then its =
interpreted as=20
FIRE .</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>public void keyPressed(int=20
keyCode)<BR> =
{<BR> =20
int keyCodeOrg=3DkeyCode;</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>System.out.println(keyCodeOrg);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> public void run() <BR> {</DIV>
<DIV> </DIV>
<DIV> while(gameRunning) //is=20
true &nb=
sp; &nbs=
p; =20
<BR> {</DIV>
<DIV> </DIV>
<DIV> =
long l1=20
=3D System.currentTimeMillis();<BR>input();</DIV>
<DIV> </DIV>
<DIV> while(System.currentTimeMillis()- l1<THREAD_WAIT);</DIV>
<DIV>}</DIV></FONT></BODY></HTML>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
[email protected] and include in the body of the message "help".
------=_NextPart_000_0008_01C944FA.91AC7100--