How to add an internationalized keyboard to your Web site

From: linux.com  read times: 103


Provided by yangyi at 2008-05-15 18:27:19


JavaScript VirtualKeyboard provides a virtual keyboard entirely written in JavaScript with more than 130 supported keyboard layouts allowing you to enter text in a variety of languages. Two uses for JavaScript VirtualKeyboard suggest themselves immediately: integrate it into your Web site to allow clients to enter internationalized text, and run it directly using the online demo when you have to enter internationalized text yourself from an Internet café.

For the latter use case, suppose you have to reply to a message that is written in Japanese, and you're in an Internet café in Europe. The cafe might not have Chinese, Japanese, and Korean (CJK) input methods set up to be easily selected. Opening the JavaScript VirtualKeyboard online demo, typing your message there, and cutting and pasting it into your webmail interface would allow you to reply in Japanese regardless of the Internet café input methods -- assuming that there are sufficient fonts on the machine to show the Unicode characters you need.

With JavaScript VirtualKeyboard you can enter characters either by using the mouse on the virtual keys or by typing on the standard hardware keyboard to actuate the corresponding virtual keys. For example, in Japanese input mode, one can type the romanji characters konnichiha on the hardware keyboard to obtain the state shown in the screenshot with the corresponding hiragana. Completions are shown as you type, allowing you to select Kanji to be inlined in the text, as you would expect from an internationalized input method.

You can change the look of the keyboard using CSS to allow it to more seamlessly blend into your existing Web site, as you'll see in a moment. The demo Web pages included in the distribution show both an embedded and popup JavaScript VirtualKeyboard.

There are many distributions of JavaScript VirtualKeyboard available. The two most interesting ones are the full and lite version. The full distribution includes all code in noncompacted form and a setup page allowing you to make your own layouts. If you intend to use JavaScript VirtualKeyboard without making a new layout yourself, then the much smaller lite download, which contains the fully functional keyboard with layouts and the JavaScript, is compacted to download slightly faster.

......

Please access the below link to view the full content.

Original link: http://www.linux.com/feature/134...