… | |
… | |
649 | bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; |
649 | bool kp = priv_modes & PrivMode_aplKP ? !shft : shft; |
650 | unsigned int newlen = 1; |
650 | unsigned int newlen = 1; |
651 | |
651 | |
652 | if (ev.state & ModNumLockMask) |
652 | if (ev.state & ModNumLockMask) |
653 | kp = false; |
653 | kp = false; |
|
|
654 | |
654 | switch (translate_keypad (keysym, kp)) |
655 | keysym = translate_keypad (keysym, kp); |
|
|
656 | |
|
|
657 | switch (keysym) |
655 | { |
658 | { |
656 | #ifndef NO_BACKSPACE_KEY |
659 | #ifndef NO_BACKSPACE_KEY |
657 | case XK_BackSpace: |
660 | case XK_BackSpace: |
658 | if (priv_modes & PrivMode_HaveBackSpace) |
661 | if (priv_modes & PrivMode_HaveBackSpace) |
659 | { |
662 | { |
… | |
… | |
768 | |
771 | |
769 | default: |
772 | default: |
770 | { |
773 | { |
771 | int param = map_function_key (keysym); |
774 | int param = map_function_key (keysym); |
772 | if (param > 0) |
775 | if (param > 0) |
|
|
776 | { |
773 | sprintf (kbuf,"\033[%d~", param); |
777 | int n = sprintf (kbuf,"\033[%d~", param); |
|
|
778 | /* |
|
|
779 | * pass Shift/Control indicators for function keys ending with `~' |
|
|
780 | * |
|
|
781 | * eg, |
|
|
782 | * Prior = "ESC[5~" |
|
|
783 | * Shift+Prior = "ESC[5$" |
|
|
784 | * Ctrl+Prior = "ESC[5^" |
|
|
785 | * Ctrl+Shift+Prior = "ESC[5@" |
|
|
786 | */ |
|
|
787 | kbuf[n-1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~')); |
|
|
788 | } |
774 | else |
789 | else |
775 | newlen = 0; |
790 | newlen = 0; |
776 | } |
791 | } |
777 | break; |
792 | break; |
778 | } |
793 | } |
… | |
… | |
829 | view_start = 0; |
844 | view_start = 0; |
830 | want_refresh = 1; |
845 | want_refresh = 1; |
831 | } |
846 | } |
832 | |
847 | |
833 | /* |
848 | /* |
834 | * these modifications only affect the static keybuffer |
|
|
835 | * pass Shift/Control indicators for function keys ending with `~' |
|
|
836 | * |
|
|
837 | * eg, |
|
|
838 | * Prior = "ESC[5~" |
|
|
839 | * Shift+Prior = "ESC[5$" |
|
|
840 | * Ctrl+Prior = "ESC[5^" |
|
|
841 | * Ctrl+Shift+Prior = "ESC[5@" |
|
|
842 | * Meta adds an Escape prefix (with META8_OPTION, if meta == <escape>). |
849 | * Meta adds an Escape prefix (with META8_OPTION, if meta == <escape>). |
843 | */ |
850 | */ |
844 | if (kbuf[0] == C0_ESC && kbuf[1] == '[' && kbuf[len - 1] == '~') |
|
|
845 | kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~')); |
|
|
846 | |
851 | |
847 | /* escape prefix */ |
852 | /* escape prefix */ |
848 | if (meta |
853 | if (meta |
849 | #ifdef META8_OPTION |
854 | #ifdef META8_OPTION |
850 | && meta_char == C0_ESC |
855 | && meta_char == C0_ESC |
… | |
… | |
1480 | selection_send (ev.xselectionrequest); |
1485 | selection_send (ev.xselectionrequest); |
1481 | break; |
1486 | break; |
1482 | |
1487 | |
1483 | case MapNotify: |
1488 | case MapNotify: |
1484 | #ifdef HAVE_BG_PIXMAP |
1489 | #ifdef HAVE_BG_PIXMAP |
1485 | /* This is needed spcifically to fix the case of no window manager or a |
1490 | /* This is needed specifically to fix the case of no window manager or a |
1486 | * non-reparenting window manager. In those cases we never get first |
1491 | * non-reparenting window manager. In those cases we never get first |
1487 | * ConfigureNotify. Also that speeds startup under normal WM, by taking |
1492 | * ConfigureNotify. Also that speeds startup under normal WM, by taking |
1488 | * care of multiplicity of ConfigureNotify events arriwing while WM does |
1493 | * care of multiplicity of ConfigureNotify events arriving while WM does |
1489 | * reparenting. |
1494 | * reparenting. |
1490 | * We should not render background immidiately, as there could be several |
1495 | * We should not render background immediately, as there could be several |
1491 | * ConfigureNotify's to follow. Lets take care of all of them in one scoop |
1496 | * ConfigureNotify's to follow. Lets take care of all of them in one scoop |
1492 | * by scheduling background redraw as soon as we can, but giving a short |
1497 | * by scheduling background redraw as soon as we can, but giving a short |
1493 | * bit of time for ConfigureNotifies to arrive. |
1498 | * bit of time for ConfigureNotifies to arrive. |
1494 | * We should render background PRIOR to drawing any text, but AFTER all |
1499 | * We should render background PRIOR to drawing any text, but AFTER all |
1495 | * of ConfigureNotifys for the best results. |
1500 | * of ConfigureNotifys for the best results. |
… | |
… | |
1866 | /* save the xbutton state (for ButtonRelease) */ |
1871 | /* save the xbutton state (for ButtonRelease) */ |
1867 | MEvent.state = ev.state; |
1872 | MEvent.state = ev.state; |
1868 | #ifdef MOUSE_REPORT_DOUBLECLICK |
1873 | #ifdef MOUSE_REPORT_DOUBLECLICK |
1869 | if (ev.button == MEvent.button && clickintime) |
1874 | if (ev.button == MEvent.button && clickintime) |
1870 | { |
1875 | { |
1871 | /* same button, within alloted time */ |
1876 | /* same button, within allowed time */ |
1872 | MEvent.clicks++; |
1877 | MEvent.clicks++; |
1873 | |
1878 | |
1874 | if (MEvent.clicks > 1) |
1879 | if (MEvent.clicks > 1) |
1875 | { |
1880 | { |
1876 | /* only report double clicks */ |
1881 | /* only report double clicks */ |
… | |
… | |
2147 | selection_make (ev.time); |
2152 | selection_make (ev.time); |
2148 | break; |
2153 | break; |
2149 | |
2154 | |
2150 | case Button2: |
2155 | case Button2: |
2151 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2156 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2152 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); |
2157 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary); |
2153 | break; |
2158 | break; |
2154 | |
2159 | |
2155 | #ifdef MOUSE_WHEEL |
2160 | #ifdef MOUSE_WHEEL |
2156 | case Button4: |
2161 | case Button4: |
2157 | case Button5: |
2162 | case Button5: |
… | |
… | |
3228 | * process DEVICE CONTROL STRING `ESC P ... (ST|BEL)' or `0x90 ... (ST|BEL)' |
3233 | * process DEVICE CONTROL STRING `ESC P ... (ST|BEL)' or `0x90 ... (ST|BEL)' |
3229 | */ |
3234 | */ |
3230 | void |
3235 | void |
3231 | rxvt_term::process_dcs_seq () |
3236 | rxvt_term::process_dcs_seq () |
3232 | { |
3237 | { |
3233 | char *s; |
|
|
3234 | unicode_t eh; |
|
|
3235 | |
|
|
3236 | /* |
3238 | /* |
3237 | * Not handled yet |
3239 | * Not handled yet |
3238 | */ |
3240 | */ |
|
|
3241 | |
|
|
3242 | unicode_t eh; |
3239 | s = get_to_st (eh); |
3243 | char *s = get_to_st (eh); |
3240 | if (s) |
3244 | if (s) |
3241 | free (s); |
3245 | free (s); |
3242 | |
3246 | |
3243 | return; |
3247 | return; |
3244 | } |
3248 | } |
… | |
… | |
3248 | * process OPERATING SYSTEM COMMAND sequence `ESC ] Ps ; Pt (ST|BEL)' |
3252 | * process OPERATING SYSTEM COMMAND sequence `ESC ] Ps ; Pt (ST|BEL)' |
3249 | */ |
3253 | */ |
3250 | void |
3254 | void |
3251 | rxvt_term::process_osc_seq () |
3255 | rxvt_term::process_osc_seq () |
3252 | { |
3256 | { |
3253 | unicode_t ch, eh; |
|
|
3254 | int arg; |
3257 | int arg; |
3255 | |
3258 | |
3256 | ch = cmd_getc (); |
3259 | unicode_t ch = cmd_getc (); |
3257 | for (arg = 0; isdigit (ch); ch = cmd_getc ()) |
3260 | for (arg = 0; isdigit (ch); ch = cmd_getc ()) |
3258 | arg = arg * 10 + (ch - '0'); |
3261 | arg = arg * 10 + (ch - '0'); |
3259 | |
3262 | |
3260 | if (ch == ';') |
3263 | if (ch == ';') |
3261 | { |
3264 | { |
|
|
3265 | unicode_t eh; |
3262 | char *s = get_to_st (eh); |
3266 | char *s = get_to_st (eh); |
3263 | |
3267 | |
3264 | if (s) |
3268 | if (s) |
3265 | { |
3269 | { |
3266 | process_xterm_seq (arg, s, eh); |
3270 | process_xterm_seq (arg, s, eh); |
… | |
… | |
3391 | process_color_seq (op, Color_pointer_fg, str, resp); |
3395 | process_color_seq (op, Color_pointer_fg, str, resp); |
3392 | break; |
3396 | break; |
3393 | case XTerm_Color_pointer_bg: |
3397 | case XTerm_Color_pointer_bg: |
3394 | process_color_seq (op, Color_pointer_bg, str, resp); |
3398 | process_color_seq (op, Color_pointer_bg, str, resp); |
3395 | break; |
3399 | break; |
|
|
3400 | #ifdef OPTION_HC |
|
|
3401 | case XTerm_Color_HC: |
|
|
3402 | process_color_seq (op, Color_HC, str, resp); |
|
|
3403 | break; |
|
|
3404 | case XTerm_Color_HTC: |
|
|
3405 | process_color_seq (op, Color_HTC, str, resp); |
|
|
3406 | break; |
|
|
3407 | #endif |
3396 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3408 | #ifndef NO_BOLD_UNDERLINE_REVERSE |
3397 | case XTerm_Color_RV: |
|
|
3398 | process_color_seq (op, Color_RV, str, resp); |
|
|
3399 | break; |
|
|
3400 | case Rxvt_Color_BD: |
|
|
3401 | case URxvt_Color_BD: |
3409 | case URxvt_Color_BD: |
3402 | process_color_seq (op, Color_BD, str, resp); |
3410 | process_color_seq (op, Color_BD, str, resp); |
3403 | break; |
3411 | break; |
3404 | case Rxvt_Color_UL: |
|
|
3405 | case URxvt_Color_UL: |
3412 | case URxvt_Color_UL: |
3406 | process_color_seq (op, Color_UL, str, resp); |
3413 | process_color_seq (op, Color_UL, str, resp); |
3407 | break; |
3414 | break; |
3408 | case URxvt_Color_IT: |
3415 | case URxvt_Color_IT: |
3409 | process_color_seq (op, Color_IT, str, resp); |
3416 | process_color_seq (op, Color_IT, str, resp); |
… | |
… | |
3576 | { |
3583 | { |
3577 | if (mode == 'r') |
3584 | if (mode == 'r') |
3578 | state = (SavedModes & bit) ? 1 : 0; /* no overlapping */ |
3585 | state = (SavedModes & bit) ? 1 : 0; /* no overlapping */ |
3579 | else |
3586 | else |
3580 | state = (mode == 't') ? ! (priv_modes & bit) : mode; |
3587 | state = (mode == 't') ? ! (priv_modes & bit) : mode; |
|
|
3588 | |
3581 | set_privmode (bit, state); |
3589 | set_privmode (bit, state); |
3582 | } |
3590 | } |
3583 | |
3591 | |
3584 | return state; |
3592 | return state; |
3585 | } |
3593 | } |
… | |
… | |
3604 | { 6, PrivMode_relOrigin }, // DECOM |
3612 | { 6, PrivMode_relOrigin }, // DECOM |
3605 | { 7, PrivMode_Autowrap }, // DECAWM |
3613 | { 7, PrivMode_Autowrap }, // DECAWM |
3606 | // 8, auto-repeat keys // DECARM |
3614 | // 8, auto-repeat keys // DECARM |
3607 | { 9, PrivMode_MouseX10 }, |
3615 | { 9, PrivMode_MouseX10 }, |
3608 | // 18 end FF to printer after print screen |
3616 | // 18 end FF to printer after print screen |
3609 | // 19 Print screen prints full screen/scorll region |
3617 | // 19 Print screen prints full screen/scroll region |
3610 | { 25, PrivMode_VisibleCursor }, // cnorm/cvvis/civis |
3618 | { 25, PrivMode_VisibleCursor }, // cnorm/cvvis/civis |
3611 | #ifdef scrollBar_esc |
3619 | #ifdef scrollBar_esc |
3612 | { scrollBar_esc, PrivMode_scrollBar }, |
3620 | { scrollBar_esc, PrivMode_scrollBar }, |
3613 | #endif |
3621 | #endif |
3614 | { 35, PrivMode_ShiftKeys }, // rxvt extension |
3622 | { 35, PrivMode_ShiftKeys }, // rxvt extension |