On Tue, 2 Oct 2012, Marco wrote:
2012-10-02 "Benjamin R. Haskell":
Hi Benjamin
When I've found sequences like this that don't have termcap/terminfo
(historical) counterparts, I've tried to do what XTerm's
"modifyOtherKeys" mode does. It uses CSI Ps[;Ps[;Ps]] ~ to provide a
more extensible set of key codes. (And, for better or worse, since
it's XTerm, it may well become a de facto standard.)
In the case of Ctrl+Tab, it produces (spaces added):
CSI 27 ; 5 ; 9 ~
27 = extended key (...I think)
5 = Ctrl ( 2 = Shift ; 6 = Ctrl+Shift ; etc. )
9 = ASCII code for Tab
So, you can add to your .Xresources/.Xdefaults:
URxvt.keysym.C-0xFF09: \033[27;5;9~
I added that line to my .Xresources and launched
xrdb -merge .Xresources
(0xFF09 = keycode for Tab according to `xev` -- is there a simpler
way? "C-Tab" didn't work.)
And add to your .vimrc:
map <Esc>[27;5;9~ <C-Tab>
I added the line and tried to create a mapping using <C-Tab>, but
unfortunately it didn't work. To avoid any interference I started vim
with -i NONE -u NONE and created a direct mapping:
map <Esc>[27;5;9~ ifoo
This also didn't work. It seems like ctrl-tab is interpreted as a
simple tab character. Did this work for you?
Yes, it worked for me.
As mentioned, the 0xFF09 in .Xresources seemed odd to me. You might try
looking at the output of `xev` (X11 Event Tester) to see the correct
code for your machine. On my current laptop (under X.Org X Server
1.12.1), hitting Ctrl+Tab, I get (among many other things):
KeyPress event, serial 33, synthetic NO, window 0x3e00001,
root 0x166, subw 0x0, time 93314998, (88,71), root:(89,94),
state 0x10, keycode 23 (keysym 0xff09, Tab), same_screen YES,
XLookupString gives 1 bytes: (09) ""
XmbLookupString gives 1 bytes: (09) ""
XFilterEvent returns: False
Possibly, also, just try the version I'd expect would work (since XK_Tab
is the name for the keysym):
URxvt.keysym.C-Tab: \033[27;5;9~
Maybe something on my system prevents that from working right.
Can I somehow verify that the keysym was successful? Thanks a lot for
your instructions.
For just testing that the .keysym. resource "takes", I've been running:
cat -v
There I see, when hitting Ctrl+Tab:
^[[27;5;9~
--
Best,
Ben
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode