LG Virtual Keyboard User Guide
LG Virtual Keyboard User Guide
Virtual Keyboard is designed to appear as below when a text input element is focused. Developers can easily use
virtual keyboard by including virtual keyboard library.
USB keyboard input and Voice Recognition are supported since NetCast 3.0(2012).
To download the Virtual Keyboard Library, go to [Resource Center > Smart TV > SDK & Tools > Sample
Codes] menu in LG Developer (http://developer.lge.com) website.
In iframe pages
<script type="text/javascript"
src="../jsLgVKeyboard/LgVKeyboardIframe.js"></script>
As Virtual Keyboard uses keydown and keyup events, use the lgKb.onKeyDown and lgKb.onKeyUp methods as
below to use keydown event in the application instead of setting handler of window.onkeydown event.
<script>
function onKeyDown(event) {
var keyCode = event.keyCode;
switch(keyCode) {
case VK_LEFT :
...
break;
case VK_RIGHT :
...
break;
...
}
}
function onKeyUp(event) {
var keyCode = event.keyCode;
switch(keyCode) {
case VK_LEFT :
...
break;
case VK_RIGHT :
...
break;
...
}
}
lgKb.onKeyDown = onKeyDown;
lgKb.onKeyUp = onKeyUp;
</script>
Virtual Keyboard library calls lgKb.onKeyboardShow or lgKb.onKeyboardHide methods after Virtual Keyboard
appear or disappear. Override the lgKb.onKeyboardShow and lgKb.onKeyboardHide methods as below for
additional task.
<script>
function onKeyboardShow(event) {
...
}
function onKeyboardHide(event) {
...
}
lgKb.onKeyboardShow = onKeyboardShow;
lgKb.onKeyboardHide = onKeyboardHide;
</script>
Tag Type
INPUT TEXT
INPUT PASSWORD
TEXTAREA
• Beware of cross-domain problem when using iframe. If an application uses multiple html files those are loaded
from different domains, cross-domain problem occurs and virtual keyboard cannot be used in iframe.
Supported Language
Virtual keyboard supports 42 languages, and 16 languages are supported for voice recognition of them.
Refer to Developing > API > Voice Recognition Plugin and API section in this Library for detailed information.