Input Method Switch applet (JS analog keyboard key input successful version)

Source: Internet
Author: User

It took half a day to write a small program that basically met the initial needs (but currently only supports IE browser).

Demand:

In the input of Chinese characters did not switch out the Chinese input method and led to the input of pinyin, we have to do is: the input pinyin to delete and switch out the Chinese input method, re-automatically in the input method to play the corresponding letter.

On my computer, there are only two input methods, Chinese Input method and American keyboard, so we can switch between two input methods by simulating "CTRL + SPACEBAR".

The process and ideas to do:

Originally thought is the use of Web pages with JS to do, after all, the interface good to do some. The first thought is to use JS to simulate the input of the keyboard, the idea is very good, but it is very difficult, mainly because the browser in order to consider security, so these features are not allowed, and therefore encountered a lot of trouble here, have to give up the idea of using JS to do. I also thought of using the analog keyboard input, but it feels too troublesome to do so. Two blog posts were inadvertently discovered (http://blog.sina.com.cn/s/blog_99baab530101a4nn.html and http://weity.blog.163.com/blog/static/ 14302652008640479337/), although there are errors, but after the reference and integration of the two blog post, the end is so-so to achieve the necessary functions.

Usage:

Without switching the Chinese input method, double-click the pinyin you have entered.

Code is not much, need is thought, not much to say, on the code, directly with IE browser can directly run.

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

As long as you want to do and strive to do, will eventually find a way, even if not done, will be in the process of the harvest a lot.

Input Method Switch applet (JS analog keyboard key input successful version)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.