comparison src/keymap.c @ 30780:b4fcea50ee82

(push_key_description): If C without modifiers is < 32, make sure to print `C-' before `M-', like in the manual.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 14 Aug 2000 12:44:38 +0000
parents 6e37e9488e49
children 442d40fce0db
comparison
equal deleted inserted replaced
30779:aa097d8d4f1a 30780:b4fcea50ee82
1822 char * 1822 char *
1823 push_key_description (c, p) 1823 push_key_description (c, p)
1824 register unsigned int c; 1824 register unsigned int c;
1825 register char *p; 1825 register char *p;
1826 { 1826 {
1827 unsigned c2;
1828
1827 /* Clear all the meaningless bits above the meta bit. */ 1829 /* Clear all the meaningless bits above the meta bit. */
1828 c &= meta_modifier | ~ - meta_modifier; 1830 c &= meta_modifier | ~ - meta_modifier;
1831 c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier
1832 | meta_modifier | shift_modifier | super_modifier);
1829 1833
1830 if (c & alt_modifier) 1834 if (c & alt_modifier)
1831 { 1835 {
1832 *p++ = 'A'; 1836 *p++ = 'A';
1833 *p++ = '-'; 1837 *p++ = '-';
1834 c -= alt_modifier; 1838 c -= alt_modifier;
1835 } 1839 }
1836 if (c & ctrl_modifier) 1840 if ((c & ctrl_modifier) != 0
1841 || (c2 < ' ' && c2 != 27 && c2 != '\t' && c2 != Ctl ('M')))
1837 { 1842 {
1838 *p++ = 'C'; 1843 *p++ = 'C';
1839 *p++ = '-'; 1844 *p++ = '-';
1840 c -= ctrl_modifier; 1845 c &= ~ctrl_modifier;
1841 } 1846 }
1842 if (c & hyper_modifier) 1847 if (c & hyper_modifier)
1843 { 1848 {
1844 *p++ = 'H'; 1849 *p++ = 'H';
1845 *p++ = '-'; 1850 *p++ = '-';
1883 *p++ = 'E'; 1888 *p++ = 'E';
1884 *p++ = 'T'; 1889 *p++ = 'T';
1885 } 1890 }
1886 else 1891 else
1887 { 1892 {
1888 *p++ = 'C'; 1893 /* `C-' already added above. */
1889 *p++ = '-';
1890 if (c > 0 && c <= Ctl ('Z')) 1894 if (c > 0 && c <= Ctl ('Z'))
1891 *p++ = c + 0140; 1895 *p++ = c + 0140;
1892 else 1896 else
1893 *p++ = c + 0100; 1897 *p++ = c + 0100;
1894 } 1898 }