This discussion is archived
2 Replies Latest reply: Jun 29, 2009 12:00 AM by 843851 RSS

VirtualKeyBoard

843851 Newbie
Currently Being Moderated
Hi,
As an improvement of the application I'm developing I have created a HVirtualKeyBoard class, so that textboxes could be edited in the normal way pushing the remote control buttons like and when you are writing a SMS, or otherwise using this keyboard. I think it is usefull because TV application are supossed to be easy to use for people of different ages, andi I can't imagine anyone who is in his/her sixties or older to managing writing text in this way. When a key of this virtual keyboard is pressed (pushing the OK buttom of the remote control) this character should be written in the focused textbox (HSingleLineEntry), but I don't manage to do that. Here is part of my code:
...
case HItemEvent.SCROLL_MORE:
                    Logger.debug(this, "processHItemEvent():SCROLL_MORE");
                    if(currentRow==ROWS-1){
                         currentRow=0;
                         
                    }
                    else{
                         currentRow++;
                    }
                    this.repaint();
                    break;
                    
               case HItemEvent.ITEM_SELECTED:
                    ((HSinglelineEntry)editComponent).requestFocus();
                    editComponent.setEditMode(true);
                    char pressedKey=chars[getCurrentRow()][getCurrentCol()];
                    //Logger.debug(this, "processHItemEvent():ITEM_SELECTED key= "+pressedKey);
                    Logger.debug(this, "currentItemChanged(): keyText= "+HKeyEvent.getKeyText(keyCodes[currentRow][currentCol]));
                    
                    editComponent.processHKeyEvent(new HKeyEvent(this,HKeyEvent.KEY_PRESSED,keyTime,keyModifiers,keyCodes[currentRow][currentCol],chars[currentRow][currentCol]));
                    editComponent.processHKeyEvent(new HKeyEvent(this,HKeyEvent.KEY_RELEASED,keyTime+2,keyModifiers,keyCodes[currentRow][currentCol],chars[currentRow][currentCol]));
could anyone help me?
thanks