ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.551 by sf-exg, Wed Jul 16 14:29:23 2014 UTC vs.
Revision 1.562 by root, Fri Nov 28 22:09:06 2014 UTC

210 210
211 max_it (width, strlen (attr)); 211 max_it (width, strlen (attr));
212 212
213 if (y >= 0) 213 if (y >= 0)
214 { 214 {
215 y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; 215 y = (y >= nrow - len - 5 && x < width + 2) ? 0 : -1;
216 x = 0; 216 x = 0;
217 } 217 }
218 218
219 scr_overlay_new (x, y, width, len * 2 + 2); 219 scr_overlay_new (x, y, width, len * 2 + 2);
220 220
315 XK_KP_7, // XK_KP_Home 315 XK_KP_7, // XK_KP_Home
316 XK_KP_4, // XK_KP_Left 316 XK_KP_4, // XK_KP_Left
317 XK_KP_8, // XK_KP_Up 317 XK_KP_8, // XK_KP_Up
318 XK_KP_6, // XK_KP_Right 318 XK_KP_6, // XK_KP_Right
319 XK_KP_2, // XK_KP_Down 319 XK_KP_2, // XK_KP_Down
320# ifndef UNSHIFTED_SCROLLKEYS
321 XK_KP_9, // XK_KP_Prior 320 XK_KP_9, // XK_KP_Prior
322 XK_KP_3, // XK_KP_Next 321 XK_KP_3, // XK_KP_Next
323# else
324 XK_Prior,
325 XK_Next,
326# endif
327 XK_KP_1, // XK_KP_End 322 XK_KP_1, // XK_KP_End
328 XK_KP_5, // XK_KP_Begin 323 XK_KP_5, // XK_KP_Begin
329 }; 324 };
330 325
331 if (IN_RANGE_INC (keysym, XK_KP_Home, XK_KP_Begin)) 326 if (IN_RANGE_INC (keysym, XK_KP_Home, XK_KP_Begin))
376 param = 3; 371 param = 3;
377 break; 372 break;
378 case XK_Select: 373 case XK_Select:
379 param = 4; 374 param = 4;
380 break; 375 break;
381#ifndef UNSHIFTED_SCROLLKEYS
382 case XK_Prior: 376 case XK_Prior:
383 param = 5; 377 param = 5;
384 break; 378 break;
385 case XK_Next: 379 case XK_Next:
386 param = 6; 380 param = 6;
389 param = 7; 383 param = 7;
390 break; 384 break;
391 case XK_End: 385 case XK_End:
392 param = 8; 386 param = 8;
393 break; 387 break;
394#endif
395 case XK_Help: 388 case XK_Help:
396 param = 28; 389 param = 28;
397 break; 390 break;
398 case XK_Menu: 391 case XK_Menu:
399 param = 29; 392 param = 29;
413 406
414void ecb_cold 407void ecb_cold
415rxvt_term::key_press (XKeyEvent &ev) 408rxvt_term::key_press (XKeyEvent &ev)
416{ 409{
417 int ctrl, meta, shft, len; 410 int ctrl, meta, shft, len;
418 KeySym keysym; 411 KeySym keysym = NoSymbol;
419 int valid_keysym;
420 char rkbuf[KBUFSZ + 1]; 412 char rkbuf[KBUFSZ + 1];
421 char *kbuf = rkbuf + 1; 413 char *kbuf = rkbuf + 1;
422 414
423#if ISO_14755 415#if ISO_14755
424 if (iso14755buf & ISO_14755_52) 416 if (iso14755buf & ISO_14755_52)
483 } 475 }
484 } 476 }
485 else 477 else
486 len = 0; 478 len = 0;
487 } 479 }
488
489 valid_keysym = status_return == XLookupKeySym
490 || status_return == XLookupBoth;
491 } 480 }
492 else 481 else
493#endif 482#endif
494 { 483 {
495 len = XLookupString (&ev, kbuf, KBUFSZ, &keysym, &compose); 484 len = XLookupString (&ev, kbuf, KBUFSZ, &keysym, &compose);
496 valid_keysym = keysym != NoSymbol;
497 } 485 }
498 486
499 if (valid_keysym) 487 if (keysym != NoSymbol)
500 { 488 {
501 KeySym orig_keysym = keysym; 489 KeySym orig_keysym = keysym;
502 490
503 /* Shift + F1 - F10 generates F11 - F20 */ 491 /* Shift + F1 - F10 generates F11 - F20 */
504 if (shft && keysym >= XK_F1 && keysym <= XK_F10) 492 if (shft && keysym >= XK_F1 && keysym <= XK_F10)
688 { 676 {
689 char *ch; 677 char *ch;
690 678
691 for (ch = kbuf; ch < kbuf + len; ch++) 679 for (ch = kbuf; ch < kbuf + len; ch++)
692 *ch |= 0x80; 680 *ch |= 0x80;
693
694 meta = 0;
695 } 681 }
696#endif 682#endif
697 /* nil */ ; 683 /* nil */ ;
698 } 684 }
699 685
712 } 698 }
713 699
714 if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_INT, keysym, DT_STR_LEN, kbuf, len, DT_END))) 700 if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_INT, keysym, DT_STR_LEN, kbuf, len, DT_END)))
715 return; 701 return;
716 702
717 if (valid_keysym) 703 if (keysym != NoSymbol)
718 { 704 {
719#ifdef KEYSYM_RESOURCE 705#ifdef KEYSYM_RESOURCE
720 if (keyboard->dispatch (this, keysym, ev.state, kbuf, len)) 706 if (keyboard->dispatch (this, keysym, ev.state, kbuf, len))
721 return; 707 return;
722#endif 708#endif
1054 { 1040 {
1055 hidden_cursor = 0; 1041 hidden_cursor = 0;
1056 want_refresh = 1; 1042 want_refresh = 1;
1057 } 1043 }
1058 1044
1059 if (option (Opt_cursorBlink)) 1045 if (option (Opt_cursorBlink) || (priv_modes & PrivMode_BlinkingCursor))
1060 cursor_blink_ev.again (); 1046 cursor_blink_ev.again ();
1061 else 1047 else
1062 cursor_blink_ev.stop (); 1048 cursor_blink_ev.stop ();
1063} 1049}
1064 1050
1925 iso14755_54 (ev.x, ev.y); 1911 iso14755_54 (ev.x, ev.y);
1926 return; 1912 return;
1927 } 1913 }
1928#endif 1914#endif
1929 1915
1930 clickintime = ev.time - MEvent.time < MULTICLICK_TIME; 1916 clickintime = ev.time - MEvent.time < multiClickTime;
1931 1917
1932 if (reportmode) 1918 if (reportmode)
1933 { 1919 {
1934 /* mouse report from vt window */ 1920 /* mouse report from vt window */
1935 /* save the xbutton state (for ButtonRelease) */ 1921 /* save the xbutton state (for ButtonRelease) */
2185#ifdef MOUSE_REPORT_DOUBLECLICK 2171#ifdef MOUSE_REPORT_DOUBLECLICK
2186 /* only report the release of 'slow' single clicks */ 2172 /* only report the release of 'slow' single clicks */
2187 if (MEvent.button != AnyButton 2173 if (MEvent.button != AnyButton
2188 && (ev.button != MEvent.button 2174 && (ev.button != MEvent.button
2189 || (ev.time - MEvent.time 2175 || (ev.time - MEvent.time
2190 > MULTICLICK_TIME / 2))) 2176 > multiClickTime / 2)))
2191 { 2177 {
2192 MEvent.clicks = 0; 2178 MEvent.clicks = 0;
2193 MEvent.button = AnyButton; 2179 MEvent.button = AnyButton;
2194 mouse_report (ev); 2180 mouse_report (ev);
2195 } 2181 }
2585 scr_charset_choose (0); 2571 scr_charset_choose (0);
2586 break; 2572 break;
2587 2573
2588#ifdef EIGHT_BIT_CONTROLS 2574#ifdef EIGHT_BIT_CONTROLS
2589 // 8-bit controls 2575 // 8-bit controls
2590 case 0x90: /* DCS */ 2576 case 0x90: /* DCS */
2591 process_dcs_seq (); 2577 process_dcs_seq ();
2592 break; 2578 break;
2593 case 0x9b: /* CSI */ 2579 case 0x9b: /* CSI */
2594 process_csi_seq (); 2580 process_csi_seq ();
2595 break; 2581 break;
2596 case 0x9d: /* OSC */ 2582 case 0x9d: /* OSC */
2597 process_osc_seq (); 2583 process_osc_seq ();
2598 break; 2584 break;
2599#endif 2585#endif
2600 } 2586 }
2601} 2587}
3106 scr_insert_mode (1); 3092 scr_insert_mode (1);
3107 else if (arg[0] == 20) 3093 else if (arg[0] == 20)
3108 priv_modes |= PrivMode_LFNL; 3094 priv_modes |= PrivMode_LFNL;
3109 break; 3095 break;
3110 3096
3111 case CSI_71: // DESCUSR: set cursor style 3097 case CSI_71: // DECSCUSR: set cursor style
3112 if (prev_ch == ' ') 3098 if (prev_ch == ' ')
3113 set_cursor_style (arg[0]); 3099 set_cursor_style (arg[0]);
3114 break; 3100 break;
3115 3101
3116 /* 3102 /*
3694 { 5, PrivMode_rVideo }, // DECSCNM 3680 { 5, PrivMode_rVideo }, // DECSCNM
3695 { 6, PrivMode_relOrigin }, // DECOM 3681 { 6, PrivMode_relOrigin }, // DECOM
3696 { 7, PrivMode_Autowrap }, // DECAWM 3682 { 7, PrivMode_Autowrap }, // DECAWM
3697 // 8, auto-repeat keys // DECARM 3683 // 8, auto-repeat keys // DECARM
3698 { 9, PrivMode_MouseX10 }, 3684 { 9, PrivMode_MouseX10 },
3685 { 12, PrivMode_BlinkingCursor },
3699 // 18 end FF to printer after print screen 3686 // 18 end FF to printer after print screen
3700 // 19 Print screen prints full screen/scroll region 3687 // 19 Print screen prints full screen/scroll region
3701 { 25, PrivMode_VisibleCursor }, // DECTCEM cnorm/cvvis/civis 3688 { 25, PrivMode_VisibleCursor }, // DECTCEM cnorm/cvvis/civis
3702#ifdef scrollBar_esc 3689#ifdef scrollBar_esc
3703 { scrollBar_esc, PrivMode_scrollBar }, 3690 { scrollBar_esc, PrivMode_scrollBar },
3812 scrollBar.map (state); 3799 scrollBar.map (state);
3813 resize_all_windows (0, 0, 0); 3800 resize_all_windows (0, 0, 0);
3814 scr_touch (true); 3801 scr_touch (true);
3815 break; 3802 break;
3816#endif 3803#endif
3804#ifdef CURSOR_BLINK
3805 case 12:
3806 cursor_blink_reset ();
3807 break;
3808#endif
3817 case 25: /* visible/invisible cursor */ 3809 case 25: /* visible/invisible cursor */
3818 scr_cursor_visible (state); 3810 scr_cursor_visible (state);
3819 break; 3811 break;
3820 /* case 35: - shift keys */ 3812 /* case 35: - shift keys */
3821 /* case 40: - 80 <--> 132 mode */ 3813 /* case 40: - 80 <--> 132 mode */
3926 //case 19: // ninth alt font 3918 //case 19: // ninth alt font
3927 //case 20: // gothic 3919 //case 20: // gothic
3928 case 21: // disable bold, faint, sometimes doubly underlined (iso 8613) 3920 case 21: // disable bold, faint, sometimes doubly underlined (iso 8613)
3929 rendset = 0, rendstyle = RS_Bold; 3921 rendset = 0, rendstyle = RS_Bold;
3930 break; 3922 break;
3931 case 22: // normal intensity 3923 case 22: // bold off (vt220)
3932 rendset = 0, rendstyle = RS_Bold; 3924 rendset = 0, rendstyle = RS_Bold;
3933 break; 3925 break;
3934 case 23: // disable italic 3926 case 23: // disable italic
3935 rendset = 0, rendstyle = RS_Italic; 3927 rendset = 0, rendstyle = RS_Italic;
3936 break; 3928 break;
3937 case 24: 3929 case 24: // underline off (vt220)
3938 rendset = 0, rendstyle = RS_Uline; 3930 rendset = 0, rendstyle = RS_Uline;
3939 break; 3931 break;
3940 case 25: 3932 case 25: // blink off (vt220)
3941 rendset = 0, rendstyle = RS_Blink; 3933 rendset = 0, rendstyle = RS_Blink;
3942 break; 3934 break;
3943 case 26: // variable spacing (iso 8613) 3935 case 26: // variable spacing (iso 8613)
3944 rendset = 0, rendstyle = RS_Blink; 3936 rendset = 0, rendstyle = RS_Blink;
3945 break; 3937 break;
3946 case 27: 3938 case 27: // reverse off (vt220)
3947 rendset = 0, rendstyle = RS_RVid; 3939 rendset = 0, rendstyle = RS_RVid;
3948 break; 3940 break;
3949 //case 28: // visible. NYI 3941 //case 28: // visible. NYI
3950 //case 29: // not crossed-out 3942 //case 29: // not crossed-out
3951 } 3943 }
4029} 4021}
4030 4022
4031void 4023void
4032rxvt_term::set_cursor_style (int style) 4024rxvt_term::set_cursor_style (int style)
4033{ 4025{
4034 if (!IN_RANGE_INC (style, 0, 4)) 4026 if (!IN_RANGE_INC (style, 0, 6))
4035 return; 4027 return;
4036 4028
4029 if (style == 0)
4030 style = 1;
4031
4032 cursor_type = (style - 1) / 2;
4037 set_option (Opt_cursorUnderline, style >= 3); 4033 set_option (Opt_cursorUnderline, cursor_type == 1);
4038 4034
4039#ifdef CURSOR_BLINK 4035#ifdef CURSOR_BLINK
4040 set_option (Opt_cursorBlink, !style || (style & 1)); 4036 set_option (Opt_cursorBlink, style & 1);
4041 cursor_blink_reset (); 4037 cursor_blink_reset ();
4042#endif 4038#endif
4043 4039
4044 want_refresh = 1; 4040 want_refresh = 1;
4045} 4041}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines