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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>when iam use in gamecanvas =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; private boolean =
input()=20
<BR>&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;int&nbsp;=20
keyStates=3DgetKeyStates();<BR>&nbsp;&nbsp;</FONT><FONT face=3DArial=20
size=3D2>&nbsp;<BR></FONT><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
if((keyStates &amp; FIRE_PRESSED) !=3D =
0)<BR>&nbsp;&nbsp;&nbsp;{</FONT></DIV>
<DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
fire_func();</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</FONT></DIV></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>public&nbsp; void keyPressed(int=20
keyCode)<BR>&nbsp;&nbsp;&nbsp; =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=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>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;public void run() <BR>&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;while(gameRunning) //is=20
true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
long l1=20
=3D System.currentTimeMillis();<BR>input();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; while(System.currentTimeMillis()- l1&lt;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--