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

Arrow keys in combination with Fx key

Expand Messages
  • Eric Leenman
    Hi, I was wondering if you can combine arrow keys with Fx keys. For example, can a mapping like be replaced with The idea is to move
    Message 1 of 4 , Oct 31, 2006
    • 0 Attachment
      Hi,

      I was wondering if you can combine arrow keys with Fx keys.
      For example, can a mapping like <CTRL><left> be replaced with <F2><left>

      The idea is to move mappings which use CTRL and ALT to Fx keys and SHIFT-Fx
      keys.
      This because CTRL and ALT are window-manager-dependend on Linux-distro's

      Best Regards,
      Eric

      _________________________________________________________________
      Find a local pizza place, music store, museum and more�then map the best
      route! http://local.live.com?FORM=MGA001
    • A.J.Mechelynck
      ... Note that, unlike with the Ctrl, Shift and Alt keys, the sequence _will_ activate the mapping. Best
      Message 2 of 4 , Nov 1, 2006
      • 0 Attachment
        Eric Leenman wrote:
        > Hi,
        >
        > I was wondering if you can combine arrow keys with Fx keys.
        > For example, can a mapping like <CTRL><left> be replaced with <F2><left>
        >
        > The idea is to move mappings which use CTRL and ALT to Fx keys and
        > SHIFT-Fx keys.
        > This because CTRL and ALT are window-manager-dependend on Linux-distro's
        >
        > Best Regards,
        > Eric

        :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.


        Best regards,
        Tony.
      • 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 3 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 4 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.