VirtualKeyboard(container, options)

new VirtualKeyboard(container, options)

A virtual keyboard component is capturing kyes that is typed from user.

Parameters:
Name Type Description
container jQuery | Element | string

Wrapper element or id selector

options object
Properties
Name Type Attributes Default Description
keyType string

Type of keyboard

keys array

Index of normal keys

functions object

Index of function keys

template object

Template set for all keys

callback object

Callback set for all keys

isClickOnly boolean

Whether the touch event is ignored or not

usageStatistics Boolean <optional>
true|false

send hostname to google analytics [default value is true]

Example
var container = document.getElementById('virtual-keyboard');
var VirtualKeyboard = tui.VirtualKeyboard; // or require('tui-virtual-keyboard');
var instance = new VirtualKeyboard(container, {
     keyType: 'number',
     keys: ['9', '3', '5', '1', '', '7', '0', '2', '4', '6', '8', ''],
     functions: {
         shuffle: 0,
         language: 2,
         caps: 3,
         symbol: 4,
         remove: 5,
         clear: 9,
         space: 10,
         close: 11,
         done: 20
     },
     template: {
         key: '<li class="subcon"><span class="btn_key"><button type="button">{KEY}</button></span></li>',
         blank: '<li class="subcon"><span class="btn_key"></span></li>',
         shuffle: '<li class="subcon"><span class="btn btn_reload"><button type="button" value="shuffle">재배열</button></span></li>',
         remove: '<li class="subcon last"><span class="btn btn_del"><button type="button" value="remove"><span class="sp">삭제</span></button></span></li>'
     },
     callback: {
         key: function() {
         },
         getKeys: function() {
         },
         remove: function() {
         }
     },
     isClickOnly: false
});

Methods

caps()

Change upper/lower case

Example
instance.caps();

close()

Close virtual keyboard

Example
instance.close();

language()

Toggle Eng/Kor

Example
instance.language();

open()

Open virtual keyboard

Example
instance.open();

shuffle()

Shuffle keys.

Example
instance.shuffle();

symbol()

Change symbol/number keys

Example
instance.symbol();