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

Comparing rxvt-unicode/src/xdefaults.C (file contents):
Revision 1.179 by mikachu, Tue Jul 29 13:50:05 2014 UTC vs.
Revision 1.184 by sf-exg, Mon Oct 13 17:05:32 2014 UTC

99 SWCH ("ic", Opt_iconic, 0, NULL), /* short form */ 99 SWCH ("ic", Opt_iconic, 0, NULL), /* short form */
100 STRG (Rs_chdir, "chdir", "cd", "string", "start shell in this directory"), 100 STRG (Rs_chdir, "chdir", "cd", "string", "start shell in this directory"),
101 SWCH ("dockapp", Opt_dockapp, 0, "start as dockapp"), 101 SWCH ("dockapp", Opt_dockapp, 0, "start as dockapp"),
102 BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"), 102 BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"),
103 BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"), 103 BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"),
104 STRG (Rs_multiClickTime, "multiClickTime", "mc", "number", "maximum time (in ms) between multi-click selections"),
104 BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"), 105 BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"),
105 BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"), 106 BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"),
106 BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"), 107 BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"),
107 RSTRG (Rs_scrollstyle, "scrollstyle", "mode"), 108 RSTRG (Rs_scrollstyle, "scrollstyle", "mode"),
108 BOOL (Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, 0, "scrollbar"), 109 BOOL (Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, 0, "scrollbar"),
706 { "4", 1, Mod4Mask }, 707 { "4", 1, Mod4Mask },
707 { "5", 1, Mod5Mask }, 708 { "5", 1, Mod5Mask },
708}; 709};
709 710
710int 711int
711rxvt_term::bind_action (const char *str, const char *arg) 712rxvt_term::parse_keysym (const char *str, unsigned int &state)
712{ 713{
713 int sym; 714 int sym;
714 unsigned int state = 0;
715 const char *key = strrchr (str, '-'); 715 const char *key = strrchr (str, '-');
716
717 state = 0;
716 718
717 if (!key) 719 if (!key)
718 key = str; 720 key = str;
719 else 721 else
720 key++; 722 key++;
721 723
722 // string or key is empty 724 // string or key is empty
723 if (*arg == '\0' || *key == '\0') 725 if (*key == '\0')
724 return -1; 726 return -1;
725 727
726 // parse modifiers 728 // parse modifiers
727 while (str < key) 729 while (str < key)
728 { 730 {
752 char *end; 754 char *end;
753 sym = strtol (str, &end, 16); 755 sym = strtol (str, &end, 16);
754 if (*end) 756 if (*end)
755 return -1; 757 return -1;
756 } 758 }
759
760 return sym;
761}
762
763int
764rxvt_term::bind_action (const char *str, const char *arg)
765{
766 int sym;
767 unsigned int state;
768
769 if (*arg == '\0' || (sym = parse_keysym (str, state)) == -1)
770 return -1;
757 771
758 wchar_t *ws = rxvt_mbstowcs (arg); 772 wchar_t *ws = rxvt_mbstowcs (arg);
759 if (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END))) 773 if (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END)))
760 keyboard->register_action (sym, state, ws); 774 keyboard->register_action (sym, state, ws);
761 775

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines