如何在 bbc/tal 中创建键盘组件

How can I create a keyboard component in bbc/tal

我正在尝试在 bbc/tal 中创建一个键盘组件,但遗憾的是它无法正常工作。我在互联网上找不到任何例子。我希望有人可以帮助我。

下面的代码是我用来创建组件的。

 var myVirtualKeyBoard = new Keyboard("keyboard",10,3,"abcdefghijklmnopqrstuvwxyz",true,true);

 myVirtualKeyBoard.setActiveChildKey('A')
 this.appendChildWidget(myVirtualKeyBoard);

它逐行显示 10* 3 个按钮,但我无法在显示屏上显示键盘

该问题与 css 样式有关。 我们可以使用下面的代码来显示键盘。

Js样本代码

keys = ['SPACE','A','B','C','D','E','F','G','H','I','1','2','3','SPACE','DEL','J','K','L','M','N','O','P','Q','R','4','5','6','DEL',' ','S','T','U','V','W','X','Y','Z',' ','7','8','9','0'];
keyboard = new Keyboard("Keyboard", 14, 3 ,keys, true , true);
keyboard.setActiveChildKey('A');
this.appendChildWidget(keyboard);

Css

#testcomponent {
display: table;
width: 100%;
height: 100%;
text-align: center;
}

Keyboard Component
#Keyboard {
display: table-cell;
width: 100%;
height: 100%;
vertical-align: middle;
}

Single Keyboard Style Changed
.keyboardButton {
display: inline-block;
}