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

Re: mapping Capslock-Key to possible?

Expand Messages
  • John Little
    ... I replied ... The X server only maps keys, not characters. The translation of key press events to characters is done in client code; take a look at vim s
    Message 1 of 8 , Aug 1, 2007
      > > Tony commented:

      > >> Can't you map CapsLock directly to Ctrl-O in Xmodmap?

      I replied

      > > I don't think so, to X ctrl-o is two keys, not one.

      Then Tony said:

      > Map it to 0x0F then? (Vim sees Ctrl-O as 0x0F, as it sees both Esc and Ctrl-[
      > as 0x1B, both Tab and Ctrl-I as 0x09, both Enter and Ctrl-M as 0x0D, etc.)

      The X server only maps keys, not characters. The translation of key
      press events to characters is done in client code; take a look at
      vim's gui_x11.c. If vim wants to treat Esc and Ctrl-[ differently it
      can.
      Anyway, my experience with something similar to the OP's requirement
      (on windows using scancode mapping) was that mapping to some unused
      but mappable key suited Vim better; the mappings that used it were
      more obvious and more straightforwardly adjusted to different modes.

      Regards, John

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Markus Schulz
      ... thanks, i ve understood this already after your first answer and solved my problem this way. ... yes another useless key, but a bit too far away for me ;)
      Message 2 of 8 , Aug 7, 2007
        Am Mittwoch, 1. August 2007 schrieb John Little:
        > My post last night was a bit muddled, I didn't have xmodmap in front
        > of me last night (er, UTC+12 that is). What you want in .xmodmaprc
        > is
        >
        > clear Lock
        > keysym Caps_Lock = F14

        thanks, i've understood this already after your first answer and solved
        my problem this way.

        > then map F14 in vim (assuming you haven't already got an F14; XFree86
        > goes up to F35). You might add
        >
        > add Lock = Scroll_Lock
        >
        > to make a useless key useful, in case you really want to shout at
        > someone.

        yes another useless key, but a bit too far away for me ;)

        --
        Markus Schulz

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.