×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question Question regarding the keypad of mobile

    I want the user to restrict the input of some keys on keypad..
    Actually i'm using Nokia 6220 Classic phone for development... How do i get the keyid of every key of keypad.. I'm using LWUIT in my application....

    One more question???

    when the user exits the application or MIDLET, the user is to be restricted and application shows message like "Do u want to exit the application" ? If yes, then exits the application and if No, remain there in the application..


    Please Reply...

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Question regarding the keypad of mobile

    Quote Originally Posted by rajan701v View Post
    I want the user to restrict the input of some keys on keypad..
    Actually i'm using Nokia 6220 Classic phone for development... How do i get the keyid of every key of keypad.. I'm using LWUIT in my application....

    One more question???

    when the user exits the application or MIDLET, the user is to be restricted and application shows message like "Do u want to exit the application" ? If yes, then exits the application and if No, remain there in the application..


    Please Reply...
    You can do the required by overwriting the keypressed(int key) method of the current LWUIT displayable on the screen and do the needful w/o passing it to the supper in case you want to capture a key.
    Thanks,
    Ekta

  3. #3
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question Re: Question regarding the keypad of mobile

    Quote Originally Posted by ektasrv View Post
    You can do the required by overwriting the keypressed(int key) method of the current LWUIT displayable on the screen and do the needful w/o passing it to the supper in case you want to capture a key.
    Thanks for the reply...
    What's the problem with this code :
    PHP Code:
    package hello;

    import com.sun.lwuit.Component;
    import com.sun.lwuit.Display;
    import com.sun.lwuit.Form;
    import com.sun.lwuit.Label;
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.midlet.*;

    /**
     * @author java
     */
    public class KeyPadMidlet extends MIDlet implements CommandListener {

        
    Display display null;
        
    Form form null;
        
    Label lbl null;

        public 
    void startApp() {
            
    display Display.getInstance();
            
    Display.init(this);
            
    form = new Form("KEY FORM");
            
    lbl = new Label();
            
    form.show();
            
    form.addComponent(lbl);
            
    form.addComponent(null, new keyListener(true));

        }

        public 
    void pauseApp() {
        }

        public 
    void destroyApp(boolean unconditional) {
            
    notifyDestroyed();
        }

        public 
    void commandAction(Command cmndDisplayable dsplbl) {
        }

        class 
    keyListener extends Component {
            
    boolean fl false;

            public 
    keyListener(boolean flag) {
                
    this.fl flag;
            }

            public 
    void keyPressed(int keycode) {
                if(
    fl==true){
                
    super.keyPressed(keycode);
                
    int k_code Display.getInstance().getKeyCode(keycode);
                switch (
    k_code) {
                    case 
    Display.GAME_UP:
                        
    lbl.setText("" k_code);
                        break;

                    case 
    Display.GAME_DOWN:
                        
    lbl.setText("" k_code);
                        break;
                    default:
                        break;
                }
            }}
        }

    It is not printing the keycode value to the label. And how will i get the keycode values for 1to 9 keys.

    Please Reply.
    Regards
    Rajan Verma

Similar Threads

  1. Replies: 1
    Last Post: 2011-01-04, 05:43
  2. how to write hindi half character from mobile keypad
    By rahulkrishna in forum Mobile Java General
    Replies: 11
    Last Post: 2009-09-02, 06:50
  3. Getting Virtual keypad of mobile
    By hallowsphere in forum Symbian C++
    Replies: 0
    Last Post: 2009-06-11, 10:35
  4. Scan Code For 1 to 10 numbers of mobile keypad
    By gtemgire in forum Symbian User Interface
    Replies: 8
    Last Post: 2007-02-27, 16:41
  5. QWERTY keypad for mobile devices
    By gentrans_tech in forum General Messaging
    Replies: 1
    Last Post: 2006-03-08, 07:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •