Mottie的虚拟键盘:直接输入

Cub*_*ius 4 javascript jquery jquery-plugins virtual-keyboard

Mottie有一个出色的jQuery屏幕键盘插件:https: //github.com/Mottie/Keyboard

默认情况下,键盘上的文本会进入其他输入,然后可以接受或取消.如果文本被接受,则进入源textarea/input.

但是有没有办法直接从键盘输入到源textarea /输入而不需要接受它(比如android/ios上的移动键盘)?

Mot*_*tie 6

该插件的文档包含在GitHub维基页面中.

该选项不需要包含预览usePreview(ref); 设置为false(演示):

要自动接受内容,请将autoAccept选项设置为true

$('#keyboard').keyboard({
    layout: 'qwerty',

    // true: preview added above keyboard;
    // false: original input/textarea used
    usePreview: false

    // Auto-accept content when clicking outside the
    // keyboard (popup will close)
    autoAccept: true

});
Run Code Online (Sandbox Code Playgroud)