… | |
… | |
25 | * - extensive modifications |
25 | * - extensive modifications |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
26 | * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> |
27 | * Copyright (c) 2001 Marius Gedminas |
27 | * Copyright (c) 2001 Marius Gedminas |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
28 | * - Ctrl/Mod4+Tab works like Meta+Tab (options) |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
29 | * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> |
30 | * Copyright (c) 2003-2011 Marc Lehmann <schmorp@schmorp.de> |
30 | * Copyright (c) 2003-2014 Marc Lehmann <schmorp@schmorp.de> |
31 | * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it> |
31 | * Copyright (c) 2007 Emanuele Giaquinta <e.giaquinta@glauco.it> |
32 | * |
32 | * |
33 | * This program is free software; you can redistribute it and/or modify |
33 | * This program is free software; you can redistribute it and/or modify |
34 | * it under the terms of the GNU General Public License as published by |
34 | * it under the terms of the GNU General Public License as published by |
35 | * the Free Software Foundation; either version 2 of the License, or |
35 | * the Free Software Foundation; either version 2 of the License, or |
… | |
… | |
398 | case XK_Menu: |
398 | case XK_Menu: |
399 | param = 29; |
399 | param = 29; |
400 | break; |
400 | break; |
401 | } |
401 | } |
402 | return param; |
402 | return param; |
|
|
403 | } |
|
|
404 | |
|
|
405 | static inline wchar_t * |
|
|
406 | rxvt_wcsdup (const wchar_t *str, int len) |
|
|
407 | { |
|
|
408 | wchar_t *r = (wchar_t *)rxvt_malloc ((len + 1) * sizeof (wchar_t)); |
|
|
409 | memcpy (r, str, len * sizeof (wchar_t)); |
|
|
410 | r[len] = 0; |
|
|
411 | return r; |
403 | } |
412 | } |
404 | |
413 | |
405 | void ecb_cold |
414 | void ecb_cold |
406 | rxvt_term::key_press (XKeyEvent &ev) |
415 | rxvt_term::key_press (XKeyEvent &ev) |
407 | { |
416 | { |
… | |
… | |
576 | case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ |
585 | case XK_KP_Subtract: /* Shift+KP_Subtract = smaller font */ |
577 | return; |
586 | return; |
578 | #endif |
587 | #endif |
579 | } |
588 | } |
580 | } |
589 | } |
|
|
590 | } |
|
|
591 | |
|
|
592 | if (ctrl && meta && (keysym == XK_c || keysym == XK_v)) |
|
|
593 | { |
|
|
594 | if (keysym == XK_v) |
|
|
595 | selection_request (ev.time, Sel_Clipboard); |
|
|
596 | else if (selection.len > 0) |
|
|
597 | { |
|
|
598 | free (selection.clip_text); |
|
|
599 | selection.clip_text = rxvt_wcsdup (selection.text, selection.len); |
|
|
600 | selection.clip_len = selection.len; |
|
|
601 | selection_grab (CurrentTime, true); |
|
|
602 | } |
|
|
603 | |
|
|
604 | return; |
581 | } |
605 | } |
582 | |
606 | |
583 | #if ENABLE_FRILLS || ISO_14755 |
607 | #if ENABLE_FRILLS || ISO_14755 |
584 | // ISO 14755 support |
608 | // ISO 14755 support |
585 | if (iso14755buf & (ISO_14755_STARTED | ISO_14755_51)) |
609 | if (iso14755buf & (ISO_14755_STARTED | ISO_14755_51)) |
… | |
… | |
1077 | |
1101 | |
1078 | #ifdef SELECTION_SCROLLING |
1102 | #ifdef SELECTION_SCROLLING |
1079 | void |
1103 | void |
1080 | rxvt_term::sel_scroll_cb (ev::timer &w, int revents) |
1104 | rxvt_term::sel_scroll_cb (ev::timer &w, int revents) |
1081 | { |
1105 | { |
1082 | if (scr_page (scroll_selection_dir, scroll_selection_lines)) |
1106 | if (scr_page (scroll_selection_lines)) |
1083 | { |
1107 | { |
1084 | selection_extend (selection_save_x, selection_save_y, selection_save_state); |
1108 | selection_extend (selection_save_x, selection_save_y, selection_save_state); |
1085 | want_refresh = 1; |
1109 | want_refresh = 1; |
1086 | refresh_check (); |
1110 | refresh_check (); |
1087 | } |
1111 | } |
… | |
… | |
1638 | |
1662 | |
1639 | #ifdef SELECTION_SCROLLING |
1663 | #ifdef SELECTION_SCROLLING |
1640 | if (ev.xbutton.y < int_bwidth |
1664 | if (ev.xbutton.y < int_bwidth |
1641 | || Pixel2Row (ev.xbutton.y) > (nrow-1)) |
1665 | || Pixel2Row (ev.xbutton.y) > (nrow-1)) |
1642 | { |
1666 | { |
|
|
1667 | page_dirn scroll_selection_dir; |
1643 | int dist; |
1668 | int dist; |
1644 | |
1669 | |
1645 | /* don't clobber the current delay if we are |
1670 | /* don't clobber the current delay if we are |
1646 | * already in the middle of scrolling. |
1671 | * already in the middle of scrolling. |
1647 | */ |
1672 | */ |
… | |
… | |
1670 | scroll_selection_lines = Pixel2Height (dist) |
1695 | scroll_selection_lines = Pixel2Height (dist) |
1671 | / SELECTION_SCROLL_LINE_SPEEDUP |
1696 | / SELECTION_SCROLL_LINE_SPEEDUP |
1672 | + 1; |
1697 | + 1; |
1673 | min_it (scroll_selection_lines, |
1698 | min_it (scroll_selection_lines, |
1674 | SELECTION_SCROLL_MAX_LINES); |
1699 | SELECTION_SCROLL_MAX_LINES); |
|
|
1700 | scroll_selection_lines *= scroll_selection_dir; |
1675 | } |
1701 | } |
1676 | else |
1702 | else |
1677 | { |
1703 | { |
1678 | /* we are within the text window, so we |
1704 | /* we are within the text window, so we |
1679 | * shouldn't be scrolling |
1705 | * shouldn't be scrolling |
… | |
… | |
3225 | rxvt_term::get_to_st (unicode_t &ends_how) |
3251 | rxvt_term::get_to_st (unicode_t &ends_how) |
3226 | { |
3252 | { |
3227 | unicode_t ch; |
3253 | unicode_t ch; |
3228 | bool seen_esc = false; |
3254 | bool seen_esc = false; |
3229 | unsigned int n = 0; |
3255 | unsigned int n = 0; |
3230 | wchar_t string[STRING_MAX]; |
3256 | wchar_t string[CBUFSIZ]; |
3231 | |
3257 | |
3232 | while ((ch = cmd_getc ()) != NOCHAR) |
3258 | while ((ch = cmd_getc ()) != NOCHAR) |
3233 | { |
3259 | { |
3234 | if (seen_esc) |
3260 | if (seen_esc) |
3235 | { |
3261 | { |
… | |
… | |
3250 | else if (ch < 0x20) |
3276 | else if (ch < 0x20) |
3251 | return NULL; /* other control character - exit */ |
3277 | return NULL; /* other control character - exit */ |
3252 | |
3278 | |
3253 | seen_esc = false; |
3279 | seen_esc = false; |
3254 | |
3280 | |
3255 | if (n >= STRING_MAX - 1) |
3281 | if (n >= sizeof (string) - 1) |
3256 | // stop at some sane length |
3282 | // stop at some sane length |
3257 | return NULL; |
3283 | return NULL; |
3258 | |
3284 | |
3259 | string[n++] = ch; |
3285 | string[n++] = ch; |
3260 | } |
3286 | } |
… | |
… | |
3377 | &nitems, &bytes_after, &value) == Success |
3403 | &nitems, &bytes_after, &value) == Success |
3378 | && actual_type != None |
3404 | && actual_type != None |
3379 | && actual_format == 8) |
3405 | && actual_format == 8) |
3380 | str = (const char *)(value); |
3406 | str = (const char *)(value); |
3381 | |
3407 | |
3382 | tt_printf ("\033]%d;%s%c", op, str, resp); |
3408 | tt_printf ("\033]%d;%s%c", op, option (Opt_insecure) ? str : "", resp); |
3383 | |
3409 | |
3384 | XFree (value); |
3410 | XFree (value); |
3385 | } |
3411 | } |
3386 | else |
3412 | else |
3387 | { |
3413 | { |