Loading ...
Sorry, an error occurred while loading the content.

571Re: Mapping irregularities

Expand Messages
  • Mac Vim Support (Axel Kielhorn)
    Mar 29, 2002
    • 0 Attachment
      After getting Vim 6.1 I modified gui_mac_doKeyEvent and now I get different results:

      Keys pressed Mac OS sends Vim sees Vim modified
      key_char modifier
      A 97 0 a a
      S-A 65 2 A A
      C-A 1 4 C-A C-A
      S-C-A 1 4+2 C-A C-A
      M-A 140 8 å å
      C-M-A 140 8+4 å å
      S-M-A 129 8+2 Å Å
      C-S-M-A 129 8+4+2 Å Å

      D-A 97 128 D-A D-a
      S-D-A 97 128+2 D-A S-D-a
      D-C-A 1 128+4 D-C-A C-D-A
      D-M-A 140 128+8 D-å M-D-å
      D-M-S-A 129 128+8+2 D-Å M-S-D-Å
      C-D-M-S-A 129 128+8+4+2 D-Å M-C-S-D-Å

      Note:
      D = Command
      M = Option
      S = Shift
      C = Controll

      I think the first bloc can stay that way. (C-å and C-Å are meaningless, thus ignoring the C- is correct)

      The second bloc is a little strange:
      D-A and S-D-A both result in a lowercase "a", in the second case with MOD_SHIFT set.
      D-M-A and D-M-S-A result in lower- and uppercase å with MOD_SHIFT set in addition to the case conversion. But in this case it is purely coincidental that the shifted letter is the upper case form of the unshifted letter. Using "y" instead of "a" results in M-D-¥ and S-M-D-ý which are completly unrelated.
      The question is: should Vim see the MOD_SHIFT here or should it be cleared?

      I haven't tested for side effects and only with CW on MacOS 8.6, nevertheless, here is the patch:

      *** gui_mac.c.orig Thu Mar 28 09:29:07 2002
      --- gui_mac.c Thu Mar 28 17:21:05 2002
      ***************
      *** 2060,2071 ****
      --- 2060,2079 ----
      /* Do not want SHIFT-A or CTRL-A with modifier */
      if (!IS_SPECIAL(key_char))
      {
      + #if 1
      + /* Clear modifiers when only one modifier is set */
      + if( (modifiers == MOD_MASK_SHIFT) ||
      + (modifiers == MOD_MASK_CTRL) ||
      + (modifiers == MOD_MASK_ALT))
      + modifiers = 0;
      + #else
      if( modifiers & MOD_MASK_CTRL)
      modifiers = modifiers & ~MOD_MASK_CTRL;
      if( modifiers & MOD_MASK_ALT)
      modifiers = modifiers & ~MOD_MASK_ALT;
      if( modifiers & MOD_MASK_SHIFT)
      modifiers = modifiers & ~MOD_MASK_SHIFT;
      + #endif
      }
      if( modifiers )
      {
    • Show all 3 messages in this topic