`:help getcharmod()` is not correct.
Result was changed by v7-0055.
And mouse double, triple and quadruple do not have individual bit.
Actual result is

  2   shift
  4   control
  8   alt
  16  meta (when it's different from ALT)
  32  mouse double click
  64  mouse triple click
  96  mouse quadruple click
  128 Macintosh only: command

Two bits are used for mouse.
0b00100000 = double
0b01000000 = triple
0b01100000 = quadruple

Dictionary version should behave as following.

function! Getcharmoddict()
  let mod = getcharmod()
  return {
        \ 'shift': mod / 2 % 2,
        \ 'control': mod / 4 % 2,
        \ 'alt': mod / 8 % 2,
        \ 'meta': mod / 16 % 2,
        \ 'mousedouble': mod / 32 % 4 == 1,
        \ 'mousetriple': mod / 32 % 4 == 2,
        \ 'mousequad': mod / 32 % 4 == 3,
        \ 'command': mod / 128 % 2,
        \ }
endfunction

-- 
Yukihiro Nakadaira - [email protected]

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui