Monday, January 21, 2013

Distinguishing between and mappings in Windows.

I see that this question was asked back in 2009, (http://tech.groups.yahoo.com/group/vim/message/105903) but I thought I'd raise it again to see if any progress had been made.

I am using gvim 7.3.762 on Windows (XP and 7) but some of the mappings I am trying to implement are failing because the <kEnter> key cannot be mapped independently of <Enter>.

To reproduce the problem, observe that the following mapping is not triggered by Enter or kEnter:

:nnoremap <kEnter> :echo "kEnter"<CR>

However, the following mapping is triggered by both Enter and kEnter:

:nnoremap <Enter> :echo "Enter"<CR>

I get the same result if I try using the termcap mapping <t_KA>. In Insert mode, both <c-v><Enter> and <c-v><kEnter> insert a ^M character. However, :echo "<\<Enter>>" outputs ">" whereas :echo "<\<kEnter>>" outputs "<<80>KA>. I'm not expert enough to know if these outputs are as expected. It looks like Vim is capable of distinguishing between the keys internally, but not when the keystrokes are supplied by Windows. Incidentally, everything works beautifully when I try it on Linux.

I am very keen to solve this problem (either by a cunning workaround, or by a patch if it does turn out to be a bug in Vim).

Thanks in advance,
Jonathan.

--
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

No comments: