JS Based on-screen keyboard for browser, like on cellphones and tablets

眉间皱痕 提交于 2019-12-17 18:24:01

问题


We have an app for an embedded system, and we are developing several apps based on HTML5, CSS3, and some JS libraries, which run on a webkit browser. I was wondering if there are any libraries that implemented on screen keyboard with customizable graphics of keys. It should also be easy to internationalize it.

May be anything based on HTML5 canvas?

I appreciate any input. Thanks!


回答1:


Something like this?

http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-keyboard-with-css-and-jquery/

Additionally, here is a (different) plugin instead of a tutorial:

http://www.sitepoint.com/jquery-on-screen-keyboard/




回答2:


You could try the Virtual Keyboard which has a lot of features, language layouts and is very well documented.
You can also easily integrate it with bootstrap:

$('#keyboard').keyboard({
    layout: 'qwerty',
    css: {
        // input & preview
        input: 'form-control input-sm',
        // keyboard container
        container: 'center-block dropdown-menu', // jumbotron
        // default state
        buttonDefault: 'btn btn-default',
        // hovered button
        buttonHover: 'btn-primary',
        // Action keys (e.g. Accept, Cancel, Tab, etc);
        // this replaces "actionClass" option
        buttonAction: 'active',
        // used when disabling the decimal button {dec}
        // when a decimal exists in the input area
        buttonDisabled: 'disabled'
    }
})

Find the full example here.

You could also try the On Screen Keyboard which is a lot simpler and less feature rich.




回答3:


I recommend simple-keyboard. Especially to those looking for a lightweight javascript virtual keyboard without any dependency (jQuery or otherwise) or are interested in a flexbox layout.

You can find the demo here: View Demo

Disclosure: I'm the author of the package. Feel free to message here or on Github with any questions or issues you have.



来源:https://stackoverflow.com/questions/8762431/js-based-on-screen-keyboard-for-browser-like-on-cellphones-and-tablets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!