Samsung i601 keypress issues

Forum for discussion on Game porting for mobile phones and j2me supported devices including device information.

Samsung i601 keypress issues

Postby abhi9cs » Thu Aug 09, 2007 6:05 am

Some of the keys of samsung i610 do not respond to keyPressed() / keyReleased() or keyRepeated().
Anyone can show me a way to solve this issue..
abhi9cs
 
Posts: 7
Joined: Thu Aug 09, 2007 5:55 am

Re: Samsung i601 keypress issues

Postby prkshsngh » Thu Aug 09, 2007 6:08 am

Try your self.
null
prkshsngh
 
Posts: 4
Joined: Thu Aug 09, 2007 4:00 am
Location: Mumbai

Postby DevelopmentTeam » Thu Aug 09, 2007 6:34 am

In this case you need to use command listener. I dont think there's an other way
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

reply

Postby abhi9cs » Thu Aug 09, 2007 6:40 am

codetiger
wat do i do with commadlistener
abhi9cs
 
Posts: 7
Joined: Thu Aug 09, 2007 5:55 am

Postby DevelopmentTeam » Thu Aug 09, 2007 6:45 am

add a command listener to the midlet and then call the keypressed function of the canvas. From the keypressed event you need to recognize the custom keycode you are sending from the midlet.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby abhi9cs » Thu Aug 09, 2007 6:47 am

can u give me a codepatch
abhi9cs
 
Posts: 7
Joined: Thu Aug 09, 2007 5:55 am

Postby DevelopmentTeam » Thu Aug 09, 2007 7:01 am

Code: Select all
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;


public class EventEx3 extends MIDlet {
    Display display;
    Command lsk;


    public EventEx3() {
        display = Display.getDisplay(this);
    }

    public void destroyApp (boolean unconditional) {
    }

    public void pauseApp () {
        System.out.println("App paused.");
    }

    public void startApp () {
       display = Display.getDisplay(this);

       Canvas canvas = new Canvas() { // anonymous class     

         public void paint(Graphics g) {
         }

         protected void keyPressed(int keyCode) {
           if (keyCode == -244) {
                       //do what ever u need when lsk is pressed
           } else if (keyCode == -243) {
                       //do what ever u need when rsk is pressed
           } else if (keyCode > 0) {
             System.out.println("keyPressed " +((char)keyCode));
           } else {
             System.out.println("keyPressed action " +getGameAction(keyCode));
           }                 
         }

         protected void keyReleased(int keyCode) {
           if (keyCode > 0) {
             System.out.println("keyReleased " +((char)keyCode));
           } else {
             System.out.println("keyReleased action " +getGameAction(keyCode));
           }
         }
      }; // end of anonymous class

      lsk = new Command("LSK", Command.STOP, 1);
      rsk = new Command("RSK", Command.STOP, 1);
      canvas.addCommand(lsk);
      canvas.addCommand(rsk);
      canvas.setCommandListener(new CommandListener() {
        public void commandAction(Command c, Displayable d) {
          if(c == lsk) {
            canva.keyPressed(-244);
          } else if(c == rsk) {
            canva.keyPressed(-243);
          } else {
            System.out.println("Saw the command: "+c);
          }
        }
      });
      display.setCurrent(canvas);
    }
}


checkout this code.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby abhi9cs » Thu Aug 09, 2007 8:51 am

Thanks but this code can not help me, although I tried this also.
I need to access all the keys n there are 10 or 12 keys can not be accessed by any how.rest is responding. but anyways if u get any other solution like any special api for this pls let me inform.
abhi9cs
 
Posts: 7
Joined: Thu Aug 09, 2007 5:55 am

Postby abhi9cs » Fri Aug 10, 2007 10:19 am

:oops:
abhi9cs
 
Posts: 7
Joined: Thu Aug 09, 2007 5:55 am

Postby DevelopmentTeam » Fri Aug 10, 2007 10:57 am

plz wait while I manage to access the mobile and test a few applications on it so that I can confirm if there is any fix for this problem.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby abhi9cs » Mon Aug 13, 2007 9:05 am

Did u get any solution yet.............
abhi9cs
 
Posts: 7
Joined: Thu Aug 09, 2007 5:55 am

Postby DevelopmentTeam » Mon Aug 13, 2007 10:14 am

Not yet, I still couldnt manage to get that device. You can better enquir other places regarding the same and meanwhile I'll post the solution if I manage to get it...
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Postby abhi9cs » Mon Aug 13, 2007 12:12 pm

Thanx for ur great effort...I will try somthing else to cope with
abhi9cs
 
Posts: 7
Joined: Thu Aug 09, 2007 5:55 am

Postby DevelopmentTeam » Mon Aug 20, 2007 11:38 am

Meanwhile if you manage to fix this problem, plz keep me posted here.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India


Return to Mobile Game Porting and Testing

Who is online

Users browsing this forum: No registered users and 1 guest

cron