--- rxvt-unicode/src/xdefaults.C 2014/05/18 18:09:52 1.177 +++ rxvt-unicode/src/xdefaults.C 2014/09/03 18:47:16 1.182 @@ -11,7 +11,7 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -98,8 +98,10 @@ SWCH ("iconic", Opt_iconic, 0, "start iconic"), SWCH ("ic", Opt_iconic, 0, NULL), /* short form */ STRG (Rs_chdir, "chdir", "cd", "string", "start shell in this directory"), + SWCH ("dockapp", Opt_dockapp, 0, "start as dockapp"), BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"), BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"), + STRG (Rs_multiClickTime, "multiClickTime", "mc", "number", "Maximum time (in ms) between multi-click selections"), BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"), BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"), BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"), @@ -707,19 +709,20 @@ }; int -rxvt_term::bind_action (const char *str, const char *arg) +rxvt_term::parse_keysym (const char *str, unsigned int &state) { int sym; - unsigned int state = 0; const char *key = strrchr (str, '-'); + state = 0; + if (!key) key = str; else key++; // string or key is empty - if (*arg == '\0' || *key == '\0') + if (*key == '\0') return -1; // parse modifiers @@ -754,9 +757,20 @@ return -1; } + return sym; +} + +int +rxvt_term::bind_action (const char *str, const char *arg) +{ + int sym; + unsigned int state; + + if (*arg == '\0' || (sym = parse_keysym (str, state)) == -1) + return -1; + wchar_t *ws = rxvt_mbstowcs (arg); - if (!HOOK_INVOKE ((this, HOOK_REGISTER_COMMAND, DT_INT, sym, DT_INT, state, DT_WCS_LEN, ws, wcslen (ws), DT_END))) - keyboard->register_action (sym, state, ws); + keyboard->register_action (sym, state, ws); free (ws); return 1;