×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    24

    get keyboard type

    I want to get keyboard type. it is qwerty or 12 keys keyboard. I write a function like that:

    Code:
    private boolean isQwertyKeyboard;
        private boolean isQwertyKeyboard_tested;
        public boolean hasQwertyKeyboard(){
        	if (isQwertyKeyboard_tested){
        		return isQwertyKeyboard;
        	} else {
        		
        		Canvas canvas = getApplicationCanvas();
        		if (canvas != null ){
        			for (int i='a';i<='z';i++){
        				try {
        					int action = canvas.getGameAction(i);
        				} catch (Exception e) {
        					isQwertyKeyboard = false;
        					isQwertyKeyboard_tested = true;
        					return false;
        				}
        			}
        			for (int i='A';i<='Z';i++){
        				try {
        					int action = canvas.getGameAction(i);
        				} catch (Exception e) {
        					isQwertyKeyboard = false;
        					isQwertyKeyboard_tested = true;
        					return false;
        				}
        			}
        			isQwertyKeyboard = true;
        			isQwertyKeyboard_tested = true;
        		}
        	}
        	return isQwertyKeyboard;
        }
    it works fine almost all phone but nokia e series. I used Canvas.getGameAction function. if you send a keycode that not exist in phone, it throws exception. and I control all chars with this function. if phone has not that chars, I can get phone has not qwerty keyboard. for example, this codes runs successfully in sonyericssons, nokia s40 ( like x3), nokia n series. and it works nokia e series that has qwerty keyboard. if phone is nokia e series and it has not qwerty keyboard (like nokia e 66) , it still responds like it has qwerty keyboard.

    is there any other way that the phone has qwerty keyboard or not ?
    Last edited by adem666; 2010-06-22 at 12:29.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: get keyboard type

    No, there is no specified way, and no way that is likely to be more reliable than what you are trying now. GameAction functionality is terribly unreliable.

    You could add to your scheme:

    Code:
    String keyboard = System.getProperty("com.nokia.keyboard.type");
    Which should return one of

    * None
    * PhoneKeypad
    * FullKeyboard
    * LimitedKeyboard4x10
    * LimitedKeyboard3x11
    * HalfKeyboard
    * Custom
    * Unknown

    On supported devices (S60 5th and some newer 3rd FP2). On other devices, it will return null.

    Graham.

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

    Re: get keyboard type

    Just to add further to what Graham has already mentioned:

    Meaning of String returned by System.getProperty("com.nokia.keyboard.type");

    None -- No keypad (for example a touch device without keypad)

    PhoneKeypad -- Standard ITU-T keypad (Phone keypad with 12 keys)

    FullKeyboard -- QWERTY (4x12 layout)

    LimitedKeyboard4x10 -- QWERTY (limited, 4x10 layout)

    LimitedKeyboard3x11 -- QWERTY (limited, 3x11 layout)


    HalfKeyboard -- Half QWERTY layout (also known as Compact QWERTY keyboard) layout.

    Note: In half QWERTY layout, a single key is used to input more than one character. This kind of text input requires the use of tapping or predictive input methods similar to Standard ITU-T keypad (PhoneKeypad)

    Custom -- Custom QWERTY layout

    Unknown -- Unknown layout

    For more info on this refer to: http://library.forum.nokia.com/index...4D1396D76.html
    Thanks,
    Ekta

  4. #4
    Registered User
    Join Date
    Mar 2006
    Posts
    24

    Re: get keyboard type

    these informations are very helpful. I tried it. I can get keyboard type. but as you graham said, I cannot get it in all phone. only some phone. I think it is nearest way to get it. thanks a lot graham and ektasrv

Similar Threads

  1. Replies: 16
    Last Post: 2008-09-30, 14:34
  2. Replies: 2
    Last Post: 2008-08-12, 17:06
  3. Replies: 0
    Last Post: 2006-07-06, 09:31
  4. How to convert type TPtr to type TBuf?
    By yfzfq in forum Symbian
    Replies: 1
    Last Post: 2004-06-02, 10:50
  5. Replies: 0
    Last Post: 2002-05-17, 12:09

Posting Permissions

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