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

Re: [macvim] modifiers should be applied to special keys too (patch)

Expand Messages
  • Benji Fisher
    ... I have uploaded the patch to http://macvim.org/OSX/files/patches/keyevent.diff (I wrote a little shell script, so I do not have to remember to make patches
    Message 1 of 16 , Sep 25, 2006
    • 0 Attachment
      On Sun, Sep 24, 2006 at 08:46:37PM +0200, Nicolas Weber wrote:
      > Hi,
      >
      > here's a patch to current svn that applies modifier keys (shift,
      > ctrl, cmd etc) to special keys as well. With this patch, Shift-Left/
      > Right work and some of the mapping problems some people complained
      > about on vim-mac@... should be fixed too.
      >
      > Please test this patch and tell me about any regressions you find.
      >
      > Bye,
      > Nico

      I have uploaded the patch to
      http://macvim.org/OSX/files/patches/keyevent.diff
      (I wrote a little shell script, so I do not have to remember to make
      patches world-readable from now on!)

      HTH --Benji Fisher
    • Bram Moolenaar
      ... Thanks for the patch. I ll send it out after some time, waiting for reports. -- This message contains 78% recycled characters. /// Bram Moolenaar --
      Message 2 of 16 , Sep 26, 2006
      • 0 Attachment
        Nicolas Weber wrote:

        > here's a patch to current svn that applies modifier keys (shift,
        > ctrl, cmd etc) to special keys as well. With this patch, Shift-Left/
        > Right work and some of the mapping problems some people complained
        > about on vim-mac@... should be fixed too.
        >
        > Please test this patch and tell me about any regressions you find.

        Thanks for the patch. I'll send it out after some time, waiting for
        reports.

        --
        This message contains 78% recycled characters.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
      • Timothy Reaves
        ... I installed it yesterday; this was one of the few things that was driving me batty. Now, my key mappings work! Thanks for the work.
        Message 3 of 16 , Sep 26, 2006
        • 0 Attachment
          On Sep 26, 2006, at 1:03 PM, Bram Moolenaar wrote:

          >
          > Nicolas Weber wrote:
          >
          >> here's a patch to current svn that applies modifier keys (shift,
          >> ctrl, cmd etc) to special keys as well. With this patch, Shift-Left/
          >> Right work and some of the mapping problems some people complained
          >> about on vim-mac@... should be fixed too.
          >>
          >> Please test this patch and tell me about any regressions you find.
          >
          > Thanks for the patch. I'll send it out after some time, waiting for
          > reports.
          >


          I installed it yesterday; this was one of the few things that was
          driving me batty. Now, my key mappings work! Thanks for the work.
        • Nicolas Weber
          Hi, ... The attached patch should fix this problem as well (again the diff is against vim svn). The problem was that chars like ^A (ctrl-a) were sent with
          Message 4 of 16 , Sep 27, 2006
          • 0 Attachment
            Hi,

            > Hmmm… I’m having a problem. Ctrl-A, ctrl-e, ctrl-k, ctrl-u, etc.
            > don’t seem to work anymore. I have these lines in my vimrc:

            The attached patch should fix this problem as well (again the diff is
            against vim svn).

            The problem was that chars like ^A (ctrl-a) were sent with
            MOD_MASK_CTRL set. I worked around this by adding the lines
            /* remove CTRL from keys that already have it */
            if (key_char < 0x20)
            vimModifiers &= ~MOD_MASK_CTRL;

            I don't know if this the right solution, but it works. At least on my
            system. :-P

            Bye,
            Nico
          • Bram Moolenaar
            ... I tried the patch, but it appears that CTRL-F and CTRL-B no longer work in Normal mode. They do something in Insert mode after CTRL-V. It looks like this
            Message 5 of 16 , Oct 3, 2006
            • 0 Attachment
              Nicolas Weber wrote:

              > > Hmmm… I’m having a problem. Ctrl-A, ctrl-e, ctrl-k, ctrl-u, etc.
              > > don’t seem to work anymore. I have these lines in my vimrc:
              >
              > The attached patch should fix this problem as well (again the diff is
              > against vim svn).
              >
              > The problem was that chars like ^A (ctrl-a) were sent with
              > MOD_MASK_CTRL set. I worked around this by adding the lines
              > /* remove CTRL from keys that already have it */
              > if (key_char < 0x20)
              > vimModifiers &= ~MOD_MASK_CTRL;
              >
              > I don't know if this the right solution, but it works. At least on my
              > system. :-P

              I tried the patch, but it appears that CTRL-F and CTRL-B no longer work
              in Normal mode. They do something in Insert mode after CTRL-V.

              It looks like this patch needs more careful testing. Perhaps you should
              make a list of keys with various modifiers that need to be tried to
              verify the code works correctly.

              --
              Engineers are always delighted to share wisdom, even in areas in which they
              have no experience whatsoever. Their logic provides them with inherent
              insight into any field of expertise. This can be a problem when dealing with
              the illogical people who believe that knowledge can only be derived through
              experience.
              (Scott Adams - The Dilbert principle)

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ download, build and distribute -- http://www.A-A-P.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
            • Nicolas Weber
              Hi, ... CTRL-F and CTRL-B work for me in Normal mode (they scroll forward/ backward). I m using mac gvim svn (patches 1-110) and the second version of my
              Message 6 of 16 , Oct 3, 2006
              • 0 Attachment
                Hi,

                > I tried the patch, but it appears that CTRL-F and CTRL-B no longer
                > work
                > in Normal mode. They do something in Insert mode after CTRL-V.

                CTRL-F and CTRL-B work for me in Normal mode (they scroll forward/
                backward). I'm using mac gvim svn (patches 1-110) and the second
                version of my patch.

                Can you give more detailed instructions on how to reproduce the problem?

                > It looks like this patch needs more careful testing. Perhaps you
                > should
                > make a list of keys with various modifiers that need to be tried to
                > verify the code works correctly.

                I made a small list ( http://macvim.blogspot.com/2006/10/keyboard-
                handling-patch.html ), I'll add further items as problems arise.

                Bye,
                Nico
              • Bram Moolenaar
                Nicolas - ... I verified I had used your second patch and found a difference. CTRL-F and CTRL-B are working now. ... Here is one key that doesn t work for me:
                Message 7 of 16 , Oct 4, 2006
                • 0 Attachment
                  Nicolas -

                  > > I tried the patch, but it appears that CTRL-F and CTRL-B no longer
                  > > work
                  > > in Normal mode. They do something in Insert mode after CTRL-V.
                  >
                  > CTRL-F and CTRL-B work for me in Normal mode (they scroll forward/
                  > backward). I'm using mac gvim svn (patches 1-110) and the second
                  > version of my patch.
                  >
                  > Can you give more detailed instructions on how to reproduce the problem?

                  I verified I had used your second patch and found a difference.
                  CTRL-F and CTRL-B are working now.

                  > > It looks like this patch needs more careful testing. Perhaps you
                  > > should
                  > > make a list of keys with various modifiers that need to be tried to
                  > > verify the code works correctly.
                  >
                  > I made a small list ( http://macvim.blogspot.com/2006/10/keyboard-
                  > handling-patch.html ), I'll add further items as problems arise.

                  Here is one key that doesn't work for me: Shift-Tab. Most notably when
                  doing command line completion, where Tab gets the next match and
                  Shift-Tab goes to the previous match.

                  Note that in Insert mode you can use CTRL-K and then a key to find out
                  what Vim gets.

                  - Bram

                  --
                  A consultant is a person who takes your money and annoys your employees while
                  tirelessly searching for the best way to extend the consulting contract.
                  (Scott Adams - The Dilbert principle)

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ download, build and distribute -- http://www.A-A-P.org ///
                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
                • Nicolas Weber
                  ... I can see it, I ll try to fix it tomorrow. I always use C-P for previous match (much easier to type imho ;-) ), so I didn t notice this... Bye, Nico
                  Message 8 of 16 , Oct 4, 2006
                  • 0 Attachment
                    > Here is one key that doesn't work for me: Shift-Tab. Most notably
                    > when
                    > doing command line completion, where Tab gets the next match and
                    > Shift-Tab goes to the previous match.

                    I can see it, I'll try to fix it tomorrow. I always use C-P for
                    previous match (much easier to type imho ;-) ), so I didn't notice
                    this...


                    Bye,
                    Nico
                  • Nicolas Weber
                    Hi, ... This is fixed in the attached patch. Another key that s still not working is Shift-Space (or Meta-Space). I ll take care of that later (but that
                    Message 9 of 16 , Oct 6, 2006
                    • 0 Attachment
                      Hi,

                      > Here is one key that doesn't work for me: Shift-Tab. Most notably
                      > when
                      > doing command line completion, where Tab gets the next match and
                      > Shift-Tab goes to the previous match.

                      This is fixed in the attached patch.

                      Another key that's still not working is Shift-Space (or Meta-Space).
                      I'll take care of that later (but that doesn't work in the current
                      mac vim either).

                      Bye,
                      Nico
                    • A.J.Mechelynck
                      ... IIUC, Shift-Space is supposed to be synonymous with Space. (When typing text, hitting the space bar produces a space regardless of whether you re typing
                      Message 10 of 16 , Oct 6, 2006
                      • 0 Attachment
                        Nicolas Weber wrote:
                        > Hi,
                        >
                        >> Here is one key that doesn't work for me: Shift-Tab. Most notably when
                        >> doing command line completion, where Tab gets the next match and
                        >> Shift-Tab goes to the previous match.
                        >
                        > This is fixed in the attached patch.
                        >
                        > Another key that's still not working is Shift-Space (or Meta-Space).
                        > I'll take care of that later (but that doesn't work in the current mac
                        > vim either).
                        >
                        > Bye,
                        > Nico
                        >
                        >
                        >

                        IIUC, Shift-Space is supposed to be synonymous with Space. (When typing text,
                        hitting the space bar produces a space regardless of whether you're typing
                        lowercase or uppercase.) As for Meta-Space (aka Alt-Space), some OSes use it
                        as a menu key, in which case it might be snatched away before Vim sees it.


                        Best regards,
                        Tony.
                      • Bram Moolenaar
                        ... Thanks. I ll try it out. -- hundred-and-one symptoms of being an internet addict: 17. You turn on your intercom when leaving the room so you can hear if
                        Message 11 of 16 , Oct 6, 2006
                        • 0 Attachment
                          Nicolas Weber wrote:

                          > > Here is one key that doesn't work for me: Shift-Tab. Most notably
                          > > when doing command line completion, where Tab gets the next match
                          > > and Shift-Tab goes to the previous match.
                          >
                          > This is fixed in the attached patch.
                          >
                          > Another key that's still not working is Shift-Space (or Meta-Space).
                          > I'll take care of that later (but that doesn't work in the current
                          > mac vim either).

                          Thanks. I'll try it out.

                          --
                          hundred-and-one symptoms of being an internet addict:
                          17. You turn on your intercom when leaving the room so you can hear if new
                          e-mail arrives.

                          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                          \\\ download, build and distribute -- http://www.A-A-P.org ///
                          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
                        • Nicolas Weber
                          Hi, ... I just noticed that this version of the patch breaks non-ascii unicode characters (umlauts for example). Damn. I ll try to write another fix to the
                          Message 12 of 16 , Oct 10, 2006
                          • 0 Attachment
                            Hi,

                            >> This is fixed in the attached patch.
                            >>
                            >> Another key that's still not working is Shift-Space (or Meta-Space).
                            >> I'll take care of that later (but that doesn't work in the current
                            >> mac vim either).
                            >
                            > Thanks. I'll try it out.

                            I just noticed that this version of the patch breaks non-ascii
                            unicode characters (umlauts for example). Damn. I'll try to write
                            another fix to the shift-tab problem that doesn't break other stuff...

                            Bye,
                            Nico
                          • Nicolas Weber
                            Hi, this version of the key event patch fixes all problems that were reported so far. Bye, Nico
                            Message 13 of 16 , Oct 15, 2006
                            • 0 Attachment
                              Hi,

                              this version of the key event patch fixes all problems that were
                              reported so far.

                              Bye,
                              Nico
                            • Bram Moolenaar
                              ... Thanks. It appears to work for me. -- A fine is a tax for doing wrong. A tax is a fine for doing well. /// Bram Moolenaar -- Bram@Moolenaar.net --
                              Message 14 of 16 , Oct 15, 2006
                              • 0 Attachment
                                Nicolas Weber wrote:

                                > this version of the key event patch fixes all problems that were
                                > reported so far.

                                Thanks. It appears to work for me.

                                --
                                A fine is a tax for doing wrong. A tax is a fine for doing well.

                                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                                /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                                \\\ download, build and distribute -- http://www.A-A-P.org ///
                                \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
                              • Benji Fisher
                                ... As usual, the patch was stripped from the vim-mac list, and I uploaded a copy from the vim-dev list to http://macvim.org/OSX/files/patches/keyevent.diff
                                Message 15 of 16 , Oct 15, 2006
                                • 0 Attachment
                                  On Sun, Oct 15, 2006 at 01:06:31PM +0200, Nicolas Weber wrote:
                                  > Hi,
                                  >
                                  > this version of the key event patch fixes all problems that were
                                  > reported so far.
                                  >
                                  > Bye,
                                  > Nico

                                  As usual, the patch was stripped from the vim-mac list, and I
                                  uploaded a copy from the vim-dev list to
                                  http://macvim.org/OSX/files/patches/keyevent.diff

                                  --Benji Fisher
                                Your message has been successfully submitted and would be delivered to recipients shortly.