I'm using Win7 as OS.

Unfortunately, when I press Control-V in insert mode and then press the back 
key, nothing happens (with mswin.vim unloaded). Sigh.
So, do you (or somebody else) know where I can get more info on OS-level key 
mappings?

Thanks for the detailed reply.
Regards,
Razvan



________________________________
 From: Tim Chase <[email protected]>
To: [email protected] 
Cc: Razvan Rotaru <[email protected]>; "[email protected]" <[email protected]> 
Sent: Wednesday, March 21, 2012 11:36 PM
Subject: Re: mapping special keys from thinkpad keyboard
 
> Is it possible to use some special keys from a ThinkPad
> keyboard for mappings? What I am looking for is to map the
> back and forward keys (above the<Left>  and<Right>  keys) to
> :tabnext and :tabprevious.

The generic answer is "if (g)vim can see them, you can map them".  The question 
then becomes, can (g)vim see them?

The easiest test is to go into insert (or command-line) mode, type control+V 
(assuming you haven't sourced the mswin.vim abomination), and then press either 
your Back or Forward button to see what (g)vim inserts.  If *nothing* shows up, 
you'll have to jump through OS-level key-remapping hoops to get vim to see it 
as a key.  On the other hand, if some escape sequence shows up, you can map 
that escape sequence, something like

  :nnoremap <esc>[123;45;678k :tabnext<cr>

where "<esc>" is 5 literal characters, and the rest is whatever sequence the 
control+V inserts.

You don't mention what OS you're running (on X systems, you should be able use 
xev to see what key sequences X sees, and setxkbmap to nudge them around if 
they aren't already producing something in xev; in other OSes, YMMV), or 
whether you're running vim or gvim.  I have some similar keys on my Lenovo 
G570, running Debian, and Fluxbox sees them as XF86AudioPrev and XF86AudioNext 
which I have mapped/intercepted to talk to xmms2 instead of passing them to 
individual applications.  On Win32 or Mac OS X, I can't be of much help.

-tim

-- You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to