BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-01-2008, 07:26 AM   #1 (permalink)
New Member
 
Join Date: May 2008
Model: 8330
Carrier: Sprint
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Storm keyboard - orientation

Please Login to Remove!

Hi All,

A few of my customers are having problems using one of my products on the Storm. It seems that when the device is oriented vertically, the numeric keyboard / keypad that is shown is missing the number 1. Instead a dot is shown in its place. However, this can be corrected by tilting the device on its side. I can definitely see this behavior when testing the app in the 9530 (Storm) simulator. I have attached a screen shot from the simulator. Does anyone know how to work around this issue?

Thanks,
Steve
Attached Images
File Type: jpg stormkeypad.JPG (13.0 KB, 31 views)
File Type: jpg stormkeypad_tilted.JPG (11.7 KB, 22 views)

Last edited by swarsa : 12-01-2008 at 07:38 AM.
Offline  
Old 12-03-2008, 07:04 AM   #2 (permalink)
New Member
 
Join Date: May 2008
Model: 8330
Carrier: Sprint
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Storm keyboard - orientation

Can someone from RIM answer this? I think other people are having this problem too - is it a bug?
Offline  
Old 12-03-2008, 07:12 AM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess here is nobody working for RIM...
try it in their official support forum: BlackBerry Support Community Forums - Java Development - BlackBerry Support Community Forums
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 12-03-2008, 07:26 AM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

This issue is also open on the RIM support forum for the past 3 days, with no response.
Offline  
Old 12-08-2008, 06:22 AM   #5 (permalink)
New Member
 
Join Date: May 2008
Model: 8330
Carrier: Sprint
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Virtual Keyboard - resolved

Well I have finally resolved this by developing my own home grown virtual keyboard. This should work until RIM fixes the bug with their virtual keyboard. In case anyone else is having the same problem, I have provide the code for it here:


Code:
public class MyVirtualKeyboard extends VerticalFieldManager
{
    // 1---2---3
    // 4---5---6
    // 7---8---9
    // .---0---x
    private ButtonField[] numbers = new ButtonField[]
    {
        new ButtonField("1", ButtonField.CONSUME_CLICK),
        new ButtonField("2", ButtonField.CONSUME_CLICK),
        new ButtonField("3", ButtonField.CONSUME_CLICK),
        new ButtonField("4", ButtonField.CONSUME_CLICK),
        new ButtonField("5", ButtonField.CONSUME_CLICK),
        new ButtonField("6", ButtonField.CONSUME_CLICK),
        new ButtonField("7", ButtonField.CONSUME_CLICK),
        new ButtonField("8", ButtonField.CONSUME_CLICK),
        new ButtonField("9", ButtonField.CONSUME_CLICK),
        new ButtonField(".", ButtonField.CONSUME_CLICK),
        new ButtonField("0", ButtonField.CONSUME_CLICK),
        new ButtonField("x", ButtonField.CONSUME_CLICK),
    };
    private ButtonField close = new ButtonField("Close",
        ButtonField.CONSUME_CLICK);
    private FieldChangeListener listener = new FieldChangeListener()
    {
        public void fieldChanged(Field f, int ctx)
        {
            if (ctx == FieldChangeListener.PROGRAMMATIC)
                return;
            String val = ((ButtonField) f).getLabel();
            if (Character.isDigit(val.charAt(0)) || val.equals(".":smileywink:)
                caller.setCharacter(val);
            else if (val.equals("x":smileywink:)
                caller.removeLastCharacter();
        }
    };
    private Caller caller;

    public MyVirtualKeyboard(Caller caller)
    {
        this.caller = caller;
        // 4 rows of buttons will be displayed
        int buttonIndex = 0;
        for (int i = 0; i < 4; i++)
        {
            HorizontalFieldManager row = new HorizontalFieldManager();
            for (int j = 0; j < 3; j++)
            {
                numbers[buttonIndex].setChangeListener(listener);
                row.add(numbers[buttonIndex++]);
            }
            add(row);
        }
        close.setChangeListener(new FieldChangeListener()
        {
            public void fieldChanged(Field field, int ctx)
            {
                MyVirtualKeyboard.this.caller.closeMe();
            }
        });
        add(close);
    }
}
Here is the interface I created callled 'Caller':


Code:
public interface Caller
{
    public void closeMe();
    public void setCharacter(String character);
    public void removeLastCharacter();
}

Here is how I invoke it (this code is in my MainScreen subclass, which is implementing FocusChangeListener and my call back interface Caller):


Code:
public void focusChanged(Field field, int ctx)    {
        currentlyEditing = null;
        if (field != checkAmt && field != taxAmt)
            return;
        if (ctx == FocusChangeListener.FOCUS_GAINED)
        {
            currentlyEditing = (BasicEditField) field;
            MyVirtualKeyboard keyboard = new MyVirtualKeyboard(this);
            popup = new PopupScreen(keyboard);
            getUiEngine().pushScreen(popup);
        }
    }
Here is the callback methods on the main screen class that take the input from the popup keyboard:

Code:
public void setCharacter(String character)
    {
        String currText = currentlyEditing.getText();
        currText += character;
        currentlyEditing.setText(currText);
    }

    public void removeLastCharacter()
    {
        String currText = currentlyEditing.getText();
        if (currText.length() == 0)
            return;
        currentlyEditing.setText(currText.substring(0, currText.length() - 1));
    }
 

  public void closeMe()
    {
        getUiEngine().popScreen(popup);
    }
Also, I have a menu item where if the user needs to display the keyboard, they can:

Code:
showKeyboard = new MenuItem("Show Keyboard", 3, 12)       {
            public void run()
            {
                MyVirtualKeyboard keyboard = new MyVirtualKeyboard(
                    MyScreen.this);
                popup = new PopupScreen(keyboard);
                getUiEngine().pushScreen(popup);
            }
        };
I have attached a picture showing what the popup virtual keyboard looks like. Hopefully this will help someone else.
Attached Images
File Type: jpg myvirtualkeyboard.JPG (11.3 KB, 9 views)
Offline  
Old 12-08-2008, 06:32 AM   #6 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

perfect, thanks for posting.
Would be nice if one of the mods put it in a sticky post for collecting usefull code snippets or created a subforum for that purpose.
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Old 02-17-2009, 11:19 AM   #7 (permalink)
JR1
New Member
 
Join Date: Feb 2009
Model: 9500
PIN: N/A
Carrier: Verizon
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Fascinating. Could this be used to replace the 'non' numeric keypad which is truly a phone pad, with a real numeric keypad with the 123 on the bottom and 789 on the top, the way God created but BB doesn't seem to get?
Thanks.
and where would one enter all this code?
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.