… | |
… | |
110 | SET_LOCALE (locale); |
110 | SET_LOCALE (locale); |
111 | |
111 | |
112 | if (status_return == XLookupChars |
112 | if (status_return == XLookupChars |
113 | || status_return == XLookupBoth) |
113 | || status_return == XLookupBoth) |
114 | { |
114 | { |
|
|
115 | /* make sure the user can type ctrl-@, i.e. NUL */ |
|
|
116 | if (len == 1 && *wkbuf == 0) |
|
|
117 | { |
|
|
118 | kbuf[0] = 0; |
|
|
119 | len = 1; |
|
|
120 | } |
|
|
121 | else |
|
|
122 | { |
115 | wkbuf[len] = 0; |
123 | wkbuf[len] = 0; |
116 | len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ); |
124 | len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ); |
117 | if (len < 0) |
125 | if (len < 0) |
118 | len = 0; |
126 | len = 0; |
|
|
127 | } |
119 | } |
128 | } |
120 | else |
129 | else |
121 | len = 0; |
130 | len = 0; |
122 | } |
131 | } |
123 | |
132 | |
… | |
… | |
141 | if (meta) |
150 | if (meta) |
142 | # endif |
151 | # endif |
143 | { |
152 | { |
144 | if (keysym == ks_bigfont) |
153 | if (keysym == ks_bigfont) |
145 | { |
154 | { |
146 | change_font (0, FONT_UP); |
155 | change_font (FONT_UP); |
147 | return; |
156 | return; |
148 | } |
157 | } |
149 | else if (keysym == ks_smallfont) |
158 | else if (keysym == ks_smallfont) |
150 | { |
159 | { |
151 | change_font (0, FONT_DN); |
160 | change_font (FONT_DN); |
152 | return; |
161 | return; |
153 | } |
162 | } |
154 | } |
163 | } |
155 | #endif |
164 | #endif |
156 | |
165 | |
… | |
… | |
229 | case XK_Insert: /* Shift+Insert = paste mouse selection */ |
238 | case XK_Insert: /* Shift+Insert = paste mouse selection */ |
230 | selection_request (ev.time, 0, 0); |
239 | selection_request (ev.time, 0, 0); |
231 | return; |
240 | return; |
232 | /* rxvt extras */ |
241 | /* rxvt extras */ |
233 | case XK_KP_Add: /* Shift+KP_Add = bigger font */ |
242 | case XK_KP_Add: /* Shift+KP_Add = bigger font */ |
234 | change_font (0, FONT_UP); |
243 | change_font (FONT_UP); |
235 | return; |
244 | return; |
236 | case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ |
245 | case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ |
237 | change_font (0, FONT_DN); |
246 | change_font (FONT_DN); |
238 | return; |
247 | return; |
239 | } |
248 | } |
240 | } |
249 | } |
241 | } |
250 | } |
242 | #ifdef PRINTPIPE |
251 | #ifdef PRINTPIPE |
… | |
… | |
653 | kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~')); |
662 | kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~')); |
654 | |
663 | |
655 | /* escape prefix */ |
664 | /* escape prefix */ |
656 | if (meta |
665 | if (meta |
657 | #ifdef META8_OPTION |
666 | #ifdef META8_OPTION |
658 | && (meta_char == C0_ESC) |
667 | && meta_char == C0_ESC |
659 | #endif |
668 | #endif |
660 | ) |
669 | ) |
661 | { |
670 | { |
662 | const unsigned char ch = C0_ESC; |
671 | const unsigned char ch = C0_ESC; |
663 | |
|
|
664 | tt_write (&ch, 1); |
672 | tt_write (&ch, 1); |
665 | } |
673 | } |
|
|
674 | |
666 | #ifdef DEBUG_CMD |
675 | #if defined(DEBUG_CMD) |
667 | if (debug_key) |
|
|
668 | { /* Display keyboard buffer contents */ |
676 | /* Display keyboard buffer contents */ |
669 | char *p; |
677 | unsigned char *p; |
670 | int i; |
678 | int i; |
671 | |
679 | |
672 | fprintf (stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len); |
680 | fprintf (stderr, "key 0x%04X [%d]: `", (unsigned int)keysym, len); |
673 | for (i = 0, p = kbuf; i < len; i++, p++) |
681 | for (i = 0, p = kbuf; i < len; i++, p++) |
674 | fprintf (stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p); |
682 | fprintf (stderr, (*p >= ' ' && *p < '\177' ? "%c" : "\\%03o"), *p); |
675 | fprintf (stderr, "'\n"); |
683 | fprintf (stderr, "'\n"); |
676 | } |
|
|
677 | #endif /* DEBUG_CMD */ |
684 | #endif /* DEBUG_CMD */ |
678 | tt_write (kbuf, (unsigned int)len); |
685 | tt_write (kbuf, (unsigned int)len); |
679 | } |
686 | } |
680 | /*}}} */ |
687 | /*}}} */ |
681 | |
688 | |
… | |
… | |
2971 | * 19 = change underlined character color |
2978 | * 19 = change underlined character color |
2972 | * 46 = change logfile (not implemented) |
2979 | * 46 = change logfile (not implemented) |
2973 | * 50 = change font |
2980 | * 50 = change font |
2974 | * |
2981 | * |
2975 | * rxvt extensions: |
2982 | * rxvt extensions: |
|
|
2983 | * 9 = change locale (NYI) |
2976 | * 10 = menu (may change in future) |
2984 | * 10 = menu (may change in future) |
2977 | * 20 = bg pixmap |
2985 | * 20 = bg pixmap |
2978 | * 39 = change default fg color |
2986 | * 39 = change default fg color |
2979 | * 49 = change default bg color |
2987 | * 49 = change default bg color |
2980 | * 55 = dump scrollback buffer and all of screen |
2988 | * 55 = dump scrollback buffer and all of screen |
… | |
… | |
3071 | set_window_color (Color_bg, str); |
3079 | set_window_color (Color_bg, str); |
3072 | break; |
3080 | break; |
3073 | case XTerm_logfile: |
3081 | case XTerm_logfile: |
3074 | break; |
3082 | break; |
3075 | case XTerm_font: |
3083 | case XTerm_font: |
3076 | change_font (0, str); |
3084 | change_font (str); |
|
|
3085 | break; |
|
|
3086 | case XTerm_locale: |
|
|
3087 | if (str[0] == '?' && !str[1]) |
|
|
3088 | tt_printf ("%-.250s\n", locale); |
|
|
3089 | else |
|
|
3090 | { |
|
|
3091 | set_locale (str); |
|
|
3092 | im_cb (); |
|
|
3093 | } |
3077 | break; |
3094 | break; |
3078 | #if 0 |
3095 | #if 0 |
3079 | case XTerm_dumpscreen: /* no error notices */ |
3096 | case XTerm_dumpscreen: /* no error notices */ |
3080 | { |
3097 | { |
3081 | int fd; |
3098 | int fd; |