aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/keymap.c b/src/keymap.c
index d577fb7acbc..3d6cf0c4723 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1824,8 +1824,12 @@ 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 {
@@ -1833,11 +1837,12 @@ push_key_description (c, p)
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 {
@@ -1885,8 +1890,7 @@ push_key_description (c, p)
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