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

Re: Arrow keys in combination with Fx key

Expand Messages
  • Eric Leenman
    Hi Tony, [snip] ... [snip] Does this mean that I can t use a mapping for F2 only? And why is their a ! behind the map in the second line? Best Regards, Eric
    Message 1 of 4 , Nov 2, 2006
    • 0 Attachment
      Hi Tony,

      [snip]
      > :map <F2><Left> <C-Left>
      > :map! <F2><Left> <C-Left>
      >
      >Note that, unlike with the Ctrl, Shift and Alt keys, the sequence <press
      >F2> <release F2> <press Left> <release Left> _will_ activate the mapping.
      >
      [snip]

      Does this mean that I can't use a mapping for F2 only?
      And why is their a ! behind the map in the second line?

      Best Regards,
      Eric

      _________________________________________________________________
      Get FREE company branded e-mail accounts and business Web site from
      Microsoft Office Live
      http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/
    • A.J.Mechelynck
      ... Also, is equivalent to , not to (the keyboard generates a release key event for F2
      Message 2 of 4 , Nov 2, 2006
      • 0 Attachment
        Eric Leenman wrote:
        > Hi Tony,
        >
        > [snip]
        >> :map <F2><Left> <C-Left>
        >> :map! <F2><Left> <C-Left>
        >>
        >> Note that, unlike with the Ctrl, Shift and Alt keys, the sequence
        >> <press F2> <release F2> <press Left> <release Left> _will_ activate
        >> the mapping.

        Also, <press F2> <Left> <Left> <release F2> is equivalent to <C-Left> <Left>,
        not to <C-Left> <C-Left> (the keyboard generates a "release key" event for F2
        but the keyboard driver ignores it).

        >>
        > [snip]
        >
        > Does this mean that I can't use a mapping for F2 only?
        > And why is their a ! behind the map in the second line?
        >
        > Best Regards,
        > Eric

        1. If you have a mapping for <F2> and another for <F2><Left>, the former won't
        be recognised until you hit a key (other than <Left>) following the F2 key, or
        until you wait longer that 'timeoutlen' milliseconds (if 'timeout' is on). It
        might be possible to program a single mapping for <F2> invoking the getchar()
        function, but IMHO the game is not worth the candle -- mapping the various F2
        + something combinations is easier to understand and therefore less error-prone.

        See
        :help map-ambiguous
        :help 'timeout'
        :help 'timeoutlen'

        2. ":map" without an exclamation mark applies to Normal and Visual modes. With
        an exclamation mark it applies to Insert/Replace and Command-line modes.

        See
        :help map-commands
        :help map-overview


        Best regards,
        Tony.
      Your message has been successfully submitted and would be delivered to recipients shortly.