0

I created the following mapping.

vmap <leftmouse> <cmd>echom getchar()<cr>

I then enter visual mode, switch to select mode by pressing <c-g>, and then drag the mouse.

After exiting visual mode, and entering :messages, I see the following output:

<80><f5>X

This occurs in Vim and Neovim.

This is intended as a minimal example to reproduce a character I saw in a different context for a Neovim plugin I've developed.

I'd like to add handling, but I'm not sure which keycode this corresponds to or what string representation I can use (e.g., "\<keycode>") for comparison.

2
  • > "This looks more like a comment than an answer." @D.BenKnoble, I think your comment in reference to an answer was posted to the wrong location (as this is a question).
    – dannyadam
    Mar 23 at 18:20
  • I’ll delete it; what actually happened (and you couldn’t know this now) is that I commented on an answer which I subsequently converted to a comment on this question. The poster appears to have deleted their comment, leaving mine looking, well, absurd :)
    – D. Ben Knoble
    Mar 23 at 18:24
2

The escape sequence <80><f5>X corresponds to <K_SPECIAL> <KS_SELECT> <KE_FILLER>. This is used internally by Vim to enable the Select mode after a mapping or menu is executed. You can refer to the following:

https://github.com/vim/vim/blob/master/src/getchar.c#L2667 https://github.com/vim/vim/blob/master/src/keymap.h#L88

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.