Learners of the Chinese language early on learn about Pinyin:

Hanyu Pinyin (simplified Chinese: 汉语拼音; traditional Chinese: 漢語拼音; pinyin: hànyǔ pīnyīn), very often shortened to just pinyin, is the official romanization system for Standard Mandarin Chinese in Mainland China, and to some extent, in Taiwan and Singapore.

Among other things, pinyin can be used on a computer to enter Chinese characters, e.g., with pinyin input, you type latin characters to get a pop-up where you can select the proper character.

It is, however, surprisingly difficult to directly enter vowels with pinyin tone marks themselves. In Windows, the Microsoft Pinyin keyboard or a separate software such as PinyinTones can be used. With both, you’ll type a syllable with the tone’s number afterwards, e.g. typing ni3 hao3 will turn into nǐ hǎo. This works, but can be cumbersome if you prefer to add the tone directly on the corresponding character when you type it.

Here is a solution which will add keyboard shortcuts for tones instead: If you follow the instructions below, you can use shortcuts to directly enter vowels with tone marks: To enter ā, (a in the first tone), press AltGr + a, followed by AltGr + 1, and so on, for the other tones and vowels. The solution itself works independently from system language or active Windows keyboard layout. This is intended for German keyboard users, see below if you use a different layout.

  1. Install Autohotkey, a free software for automating Windows using hotkeys. You can find installation and set up instructions here.
  2. Download the script file Pinyin.ahk.
  3. From your download folder, move the file Pinyin.ahk to your desktop. This way, you can easily access it after a reboot.
  4. On your desktop, double-click the Pinyin.ahk file.
  5. Now, you can use shortcuts to enter vowels with tone marks as described above: To enter ā, (a in the first tone), press AltGr + a, followed by AltGr + 1.
First press... then press... to get First press... then press... to get
AltGr+a AltGr+1 ā AltGr+i AltGr+1 ī
AltGr+a AltGr+2 á AltGr+i AltGr+2 í
AltGr+a AltGr+3 ǎ AltGr+i AltGr+3 ǐ
AltGr+a AltGr+4 à AltGr+i AltGr+4 ì
AltGr+o AltGr+1 ō AltGr+u AltGr+1 ū
AltGr+o AltGr+2 ó AltGr+u AltGr+2 ú
AltGr+o AltGr+3 ǒ AltGr+u AltGr+3 ǔ
AltGr+o AltGr+4 ò AltGr+u AltGr+4 ù
AltGr+e AltGr+1 ē AltGr+ü AltGr+1 ǖ
AltGr+e AltGr+2 é AltGr+ü AltGr+2 ǘ
AltGr+e AltGr+3 ě AltGr+ü AltGr+3 ǚ
AltGr+e AltGr+4 è AltGr+ü AltGr+4 ǜ

Adapt to work with other keyboard layouts

Although the solution was developed for German keyboard users and therefore uses the AltGr key, which is not present on all keyboard layouts (e.g., US layout), you can adapt the solution to use for example Alt+Shift instead. In the Pinyin.ahk script file, replace <^>! with one or more other hotkey modifier symbols to change the hotkey. Also, if you use a keyboard that has no native ü key, you’ll want to change the two lines:

   <^>!ü::return
   #If, A_PriorHotkey = "<^>!ü"

into

   <^>!v::return
   #If, A_PriorHotkey = "<^>!v"

instead to use Alt+Shift+v instead of Alt+Shift+ü.

Please go here to comment this article.