BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 12-01-2008, 08:26 AM   #1
swarsa
New Member
 
Join Date: May 2008
Model: 8330
Carrier: Sprint
Posts: 14
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 08:38 AM..
Offline  
Old 12-03-2008, 08:04 AM   #2
swarsa
New Member
 
Join Date: May 2008
Model: 8330
Carrier: Sprint
Posts: 14
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, 08:12 AM   #3
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
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, 08:26 AM   #4
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

This issue is also open on the RIM support forum for the past 3 days, with no response.
Offline  
Old 12-08-2008, 07:22 AM   #5
swarsa
New Member
 
Join Date: May 2008
Model: 8330
Carrier: Sprint
Posts: 14
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, 07:32 AM   #6
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
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, 12:19 PM   #7
JR1
New Member
 
Join Date: Feb 2009
Model: 9500
PIN: N/A
Carrier: Verizon
Posts: 4
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


4 Count Case GE ProLine 2 Bulb 120V T12 Electronic Fluorescent Light Ballasts picture

4 Count Case GE ProLine 2 Bulb 120V T12 Electronic Fluorescent Light Ballasts

$49.99



 GE Electronic Ballast 446LSLHTCP 120V 60 HZ 89707 picture

GE Electronic Ballast 446LSLHTCP 120V 60 HZ 89707

$149.99



Philips ADVANCE AmbiStar RELB-2S40-N Replacement Ballast 40-Watt 2-Lamp T12 picture

Philips ADVANCE AmbiStar RELB-2S40-N Replacement Ballast 40-Watt 2-Lamp T12

$18.79



QHE 4X32T8/UNV ISH-SC Sylvania 51347 4-Lamp T8 Instant Start Fluorescent Ballast picture

QHE 4X32T8/UNV ISH-SC Sylvania 51347 4-Lamp T8 Instant Start Fluorescent Ballast

$10.79



10-Count GE Fluorescent Ballast, GE432-MVPS-L Electronic T8, 120v to 277v picture

10-Count GE Fluorescent Ballast, GE432-MVPS-L Electronic T8, 120v to 277v

$108.99



Ballast Box 3 Point Hitch Counterweight for Cat 1 Category 1 Tractor 800lb Green picture

Ballast Box 3 Point Hitch Counterweight for Cat 1 Category 1 Tractor 800lb Green

$192.99







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