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.
- Install Autohotkey, a free software for automating Windows using hotkeys. You can find installation and set up instructions here.
- Download the script file Pinyin.ahk.
- From your download folder, move the file Pinyin.ahk to your desktop. This way, you can easily access it after a reboot.
- On your desktop, double-click the Pinyin.ahk file.
- 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|
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
<^>! 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 = "<^>!ü"
<^>!v::return #If, A_PriorHotkey = "<^>!v"
instead to use Alt+Shift+v instead of Alt+Shift+ü.
Please go here to comment this article.