diff -Naur xkeyboard-config-2.21/rules/base.xml.in xkeyboard-config-2.21-new/rules/base.xml.in --- xkeyboard-config-2.21/rules/base.xml.in 2017-05-31 11:39:24.000000000 -0400 +++ xkeyboard-config-2.21-new/rules/base.xml.in 2018-02-19 18:48:02.957000000 -0500 @@ -2334,6 +2334,15 @@ + + + altgr-pinyin + <_description>Hanyu Pinyin (altgr) + + chi + + + diff -Naur xkeyboard-config-2.21/symbols/cn xkeyboard-config-2.21-new/symbols/cn --- xkeyboard-config-2.21/symbols/cn 2017-05-31 11:39:24.000000000 -0400 +++ xkeyboard-config-2.21-new/symbols/cn 2018-02-19 18:49:23.121124100 -0500 @@ -200,3 +200,35 @@ key { [ period, 0x1002039 ] }; // . ‹ key { [ 0x1000626, Arabic_question_mark ] }; // ئ ؟ }; + +// Pinyin Keyboard, in the style of altgr-intl +// +// Chinese speakers and learners often find it hard to type Hanyu Pinyin +// with all its tones and ü. This file defines an altgr-intl-like behavior. +// +// Number row keys 1 2 3 4 are defined as dead-keys for the tones. +// They correspond to the four tones in Hanyu Pinyin. +// +// To generate a raw ü, use AltGr + v. +// V is used instead of ü for tones. +// +// This file should be used with an appropriate XCompose file with +// definitons for dead_{macron,acute,caron,grave} + a/e/i/o/u/v(ü). +// en_US.UTF-8's Compose may be used for this purpose. +// --Mingye Wang + +partial alphanumeric_keys +xkb_symbols "altgr-pinyin" { + include "us(basic)" + name[Group1]= "Chinese (Pinyin numeric tone dead keys)"; + + key { [ 1, exclam, dead_macron, macron ] }; + key { [ 2, at, dead_acute, acute ] }; + key { [ 3, numbersign, dead_caron, caron ] }; + key { [ 4, dollar, dead_grave, grave ] }; + + key { [ v, V, udiaeresis, Udiaeresis ] }; + + include "level3(ralt_switch)" +}; +