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

RE: Keypad decimal: . or ,?

Expand Messages
  • Vince Negri
    The clue is in the name VK_DECIMAL. The key is *meant* to generate whatever character is used for a decimal point in that locale. In UK/US, for example, it s a
    Message 1 of 6 , Oct 20, 2004
    • 0 Attachment
      The clue is in the name VK_DECIMAL. The key
      is *meant* to generate whatever character is used for a decimal point
      in that locale. In UK/US, for example, it's a full stop. In other
      locales, it could be a comma.

      Anyway, the call you want is

      UINT charcode = MapVirtualKey(VK_DECIMAL, 2);


      Then charcode should be the ascii for comma or fullstop
      as required.


      > -----Original Message-----
      > From: Bram Moolenaar [SMTP:Bram@...]
      >
      > The complicated way would be to find out what actually is on the
      > keyboard key. No idea what MS-Windows library call to use for that.
      >
      >
      >
      Legal Disclaimer: Any views expressed by the sender of this message are
      not necessarily those of Application Solutions Ltd. Information in this
      e-mail may be confidential and is for the use of the intended recipient
      only, no mistake in transmission is intended to waive or compromise such
      privilege. Please advise the sender if you receive this e-mail by mistake.
    • Bram Moolenaar
      ... Thanks for the hint. I ll try it out when I have time. -- hundred-and-one symptoms of being an internet addict: 211. Your husband leaves you...taking the
      Message 2 of 6 , Oct 20, 2004
      • 0 Attachment
        Vince Negri wrote:

        > The clue is in the name VK_DECIMAL. The key
        > is *meant* to generate whatever character is used for a decimal point
        > in that locale. In UK/US, for example, it's a full stop. In other
        > locales, it could be a comma.
        >
        > Anyway, the call you want is
        >
        > UINT charcode = MapVirtualKey(VK_DECIMAL, 2);
        >
        >
        > Then charcode should be the ascii for comma or fullstop
        > as required.

        Thanks for the hint. I'll try it out when I have time.

        --
        hundred-and-one symptoms of being an internet addict:
        211. Your husband leaves you...taking the computer with him and you
        call him crying, and beg him to bring the computer back.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
        \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
      • Marcus Aurelius
        ... How do i configure Vim to do so? ;-) But then, Vim should repaint the key when exiting! ... Oh, now i know why it s handled differently. Anyway, kPoint key
        Message 3 of 6 , Oct 20, 2004
        • 0 Attachment
          --- Bram Moolenaar <Bram@...> escreveu:
          >
          > Marcus Aurelius wrote:
          >
          > > I'm using Vim 6.3 on Windows. My brazilian keyboard
          > > has a "," (comma) as the number keypad decimal point.
          > > But Vim seems to have a "." (dot) hardcoded for that
          > > key (at least on Windows).
          >
          > The simplest solution is to scrape off a bit of the ink, so that the
          > comma looks like a full stop. :-)

          How do i configure Vim to do so? ;-)
          But then, Vim should repaint the key when exiting!

          > If you do this then the comma (or dot) arrives as a normal character,
          > you can't map it separately from the "ordinary" comma or dot key.

          Oh, now i know why it's handled differently. Anyway, kPoint key produces an
          ordinary character under some circumstances (an SSH shell i use and Mingw Vim,
          for example), that's why i was seeing that behavior only on Windows GVim.

          > Instead of patching the code, you can probably do:
          >
          > :noremap <kPoint> ,
          > :noremap! <kPoint> ,
          >
          > Let me know if this works, then I'll add a remark in the docs.

          Yes, the mappings work as expected.

          > The complicated way would be to find out what actually is on the
          > keyboard key. No idea what MS-Windows library call to use for that.

          If Vince Negri's tip can be used, it would be a nice addition (it's surprising
          for users to have a key that works differently in GVim...).

          __________________________________________________
          Do You Yahoo!?
          Tired of spam? Yahoo! Mail has the best spam protection around
          http://mail.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.