AutocompleteUI + jQuery 屏幕键盘

AutocompleteUI + jQuery On-Screen Keyboard

我有搜索栏和虚拟键盘。从我的桌面键盘输入一些字母后,一切正常,并在单独的 div.

中打印结果

当我想得到结果时,用虚拟键盘写一些字母或单词,没有任何反应。我知道我需要在这个虚拟键盘上使用回调。但是我觉得很难做到!提前致谢!

自动完成代码:

var some_array = [  {...},
                        {...},
                        ...];
$(function() {
    $("#tags").autocomplete({
        source: some_array,
        autoFocus: true,
        minLength: 0,
        delay: 400,
        suggest: function(items) {
            $('.results').hide(); 
            $(".results").empty();
            for (i = 0; i < items.length; i++){
                var person = $('<div id="pers" style="pers"><img src="./img/photo/'+ items[i].value +'.jpg" class="photo_preview">'+ items[i].label +'<br /><br /><small>'+ items[i].desc +'</small></div>');
                $(".results").append(person);
            }
            $(".results").show(200);
        }
    });    
});

库键盘小部分,按下后触发:

write: function(m) {
           var a = jsKeyboard.currentElement.val(),
           b = String.fromCharCode(m),
           pos = jsKeyboard.currentElementCursorPosition,
           output = [a.slice(0, pos), b, a.slice(pos)].join('');
           jsKeyboard.currentElement.val(output);
           jsKeyboard.currentElementCursorPosition++; //+1 cursor
           jsKeyboard.updateCursor();
       }

我无法设置合适的侦听器,以不同的方式解决了问题。安装了 chrome 虚拟键盘的扩展,没有问题。 P. S. 为触摸屏面板开发软件,而不是为 public,因此对于 1 个工作站是理想的。谢谢大家