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.183 by root, Tue Dec 21 06:43:00 2004 UTC vs.
Revision 1.190 by root, Mon Jan 17 00:59:23 2005 UTC

48#include "../config.h" /* NECESSARY */ 48#include "../config.h" /* NECESSARY */
49#include "rxvt.h" /* NECESSARY */ 49#include "rxvt.h" /* NECESSARY */
50#include "version.h" 50#include "version.h"
51#include "command.h" 51#include "command.h"
52 52
53#ifdef KEYSYM_RESOURCE
54# include "keyboard.h"
55#endif
56
53#include <cwchar> 57#include <cwchar>
54#include <csignal> 58#include <csignal>
55 59
56/*----------------------------------------------------------------------*/ 60/*----------------------------------------------------------------------*/
57 61
344 valid_keysym = keysym != NoSymbol; 348 valid_keysym = keysym != NoSymbol;
345 } 349 }
346 350
347 if (valid_keysym) 351 if (valid_keysym)
348 { 352 {
353#ifdef KEYSYM_RESOURCE
354 if (keyboard->dispatch (this, keysym, ev.state))
355 return;
356#endif
357
349 if (TermWin.saveLines) 358 if (TermWin.saveLines)
350 { 359 {
351#ifdef UNSHIFTED_SCROLLKEYS 360#ifdef UNSHIFTED_SCROLLKEYS
352 if (!ctrl && !meta) 361 if (!ctrl && !meta)
353#else 362#else
487 } 496 }
488#endif 497#endif
489 498
490 if (keysym >= 0xFF00 && keysym <= 0xFFFF) 499 if (keysym >= 0xFF00 && keysym <= 0xFFFF)
491 { 500 {
492#ifdef KEYSYM_RESOURCE
493 if (!(shft | ctrl) && Keysym_map[keysym & 0xFF] != NULL)
494 {
495 unsigned int l;
496 const unsigned char *kbuf0;
497
498 kbuf0 = (Keysym_map[keysym & 0xFF]);
499 l = (unsigned int)*kbuf0++;
500
501 /* escape prefix */
502 if (meta
503# ifdef META8_OPTION
504 && meta_char == C0_ESC
505# endif
506 )
507 {
508 const unsigned char ch = C0_ESC;
509 tt_write (&ch, 1);
510 }
511
512 tt_write (kbuf0, l);
513 return;
514 }
515 else
516#endif
517 { 501 {
518 newlen = 1; 502 newlen = 1;
519 switch (keysym) 503 switch (keysym)
520 { 504 {
521#ifndef NO_BACKSPACE_KEY 505#ifndef NO_BACKSPACE_KEY
785 case XK_F35: /* "\033[49~" */ 769 case XK_F35: /* "\033[49~" */
786 FKEY (31, XK_F17); 770 FKEY (31, XK_F17);
787 break; 771 break;
788#undef FKEY 772#undef FKEY
789 default: 773 default:
790 if (len == 0 774 newlen = 0;
791 && (keysym & 0xfff0) != 0xff70 775 break;
792 && (keysym & 0xfff0) != 0xffe0)
793 /* generate a keycode for every remaining keypress */
794 sprintf ((char *)kbuf, "\033[%x;%xA", (unsigned char)ev.state, (unsigned short)keysym);
795 } 776 }
796 777
797 if (newlen) 778 if (newlen)
798 len = strlen (kbuf); 779 len = strlen (kbuf);
799 } 780 }
814 } 795 }
815 else if (keysym == XK_ISO_Left_Tab) 796 else if (keysym == XK_ISO_Left_Tab)
816 { 797 {
817 strcpy (kbuf, "\033[Z"); 798 strcpy (kbuf, "\033[Z");
818 len = 3; 799 len = 3;
819 }
820 else if (len == 0
821 && (keysym & 0xffe0) != 0xfe00
822 && (keysym < 0xfe50 || keysym > 0xfe6f))
823 {
824 /* generate a keycode for every remaining keypress */
825 len = sprintf ((char *)kbuf, "\033[%x;%xA", (unsigned char)ev.state, (unsigned short)keysym);
826 } 800 }
827 else 801 else
828 { 802 {
829#ifdef META8_OPTION 803#ifdef META8_OPTION
830 /* set 8-bit on */ 804 /* set 8-bit on */
889#endif /* DEBUG_CMD */ 863#endif /* DEBUG_CMD */
890 tt_write (kbuf, (unsigned int)len); 864 tt_write (kbuf, (unsigned int)len);
891} 865}
892/*}}} */ 866/*}}} */
893 867
894#if (MENUBAR_MAX) 868#if MENUBAR_MAX || defined (KEYSYM_RESOURCE)
895/*{{{ rxvt_cmd_write (), rxvt_cmd_getc () */ 869/*{{{ rxvt_cmd_write (), rxvt_cmd_getc () */
896/* attempt to `write' count to the input buffer */ 870/* attempt to `write' count to the input buffer */
897unsigned int 871unsigned int
898rxvt_term::cmd_write (const unsigned char *str, unsigned int count) 872rxvt_term::cmd_write (const unsigned char *str, unsigned int count)
899{ 873{
922 896
923 cmd_parse (); 897 cmd_parse ();
924 898
925 return 0; 899 return 0;
926} 900}
927#endif /* MENUBAR_MAX */ 901#endif
928 902
929void 903void
930rxvt_term::flush () 904rxvt_term::flush ()
931{ 905{
932 flush_ev.stop (); 906 flush_ev.stop ();
1033{ 1007{
1034 if (mouse_slip_wheel_speed == 0 1008 if (mouse_slip_wheel_speed == 0
1035 || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed) 1009 || mouse_slip_wheel_speed < 0 ? scr_page (DN, -mouse_slip_wheel_speed)
1036 : scr_page (UP, mouse_slip_wheel_speed)) 1010 : scr_page (UP, mouse_slip_wheel_speed))
1037 { 1011 {
1012 if (TermWin.view_start == TermWin.nscrolled ||
1013 TermWin.view_start == 0)
1014 mouse_slip_wheel_speed = 0;
1015
1038 refresh_type |= SMOOTH_REFRESH; 1016 refresh_type |= SMOOTH_REFRESH;
1039 want_refresh = 1; 1017 want_refresh = 1;
1040 w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY); 1018 w.start (w.at + SCROLLBAR_CONTINUOUS_DELAY);
1041 } 1019 }
1042} 1020}
1105rxvt_term::pointer_blank () 1083rxvt_term::pointer_blank ()
1106{ 1084{
1107 if (! (options & Opt_pointerBlank)) 1085 if (! (options & Opt_pointerBlank))
1108 return; 1086 return;
1109 1087
1110 XDefineCursor (display->display, TermWin.vt, blank_cursor); 1088 XDefineCursor (display->display, TermWin.vt, display->blank_cursor);
1111 XFlush (display->display); 1089 XFlush (display->display);
1112 1090
1113 hidden_pointer = 1; 1091 hidden_pointer = 1;
1114} 1092}
1115 1093
1767 { 1745 {
1768 case Button1: 1746 case Button1:
1769 /* allow meta + click to select rectangular areas */ 1747 /* allow meta + click to select rectangular areas */
1770 /* should be done in screen.C */ 1748 /* should be done in screen.C */
1771#if ENABLE_FRILLS 1749#if ENABLE_FRILLS
1772 selection.rect = !! (ev.state & ModMetaMask); 1750 selection.rect = !!(ev.state & ModMetaMask);
1773#else 1751#else
1774 selection.rect = false; 1752 selection.rect = false;
1775#endif 1753#endif
1776 1754
1777 /* allow shift+left click to extend selection */ 1755 /* allow shift+left click to extend selection */
3850 if (query) 3828 if (query)
3851 tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp); 3829 tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp);
3852 else 3830 else
3853 { 3831 {
3854 set_locale (str); 3832 set_locale (str);
3833 pty.set_utf8_mode (enc_utf8);
3855# ifdef USE_XIM 3834# ifdef USE_XIM
3856 im_cb (); 3835 im_cb ();
3857# endif 3836# endif
3858 } 3837 }
3859 break; 3838 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines