FedoraForum.org - Fedora Support Forums and Community
Results 1 to 5 of 5
  1. #1
    mischmitz Guest

    How to map CAPS to Hyper modifier

    Hello all,

    I just tried to my CAPS key to a Hyper modifier as I successfully did in Fedora Core 5.

    First I added the following block to /usr/share/X11/xkb/symbols/capslock:

    partial modifier_keys
    xkb_symbols "super_caps" {
    key <CAPS> { [ Super_L, Super_R ] };
    modifier_map Mod4 { Super_L, Super_R };
    };

    partial modifier_keys
    xkb_symbols "hyper_caps" {
    key <CAPS> { [ Hyper_L, Hyper_R ] };
    modifier_map Mod4 { Hyper_L, Hyper_R };
    };

    Afterwards I changed added

    caps:super_caps CapsLock generates modifier Super.
    caps:hyper_caps CapsLock generates modifier Hyper.


    to the options section in usr/share/X11/xkb/rules/base.lst and

    <option>
    <configItem>
    <name>caps:super_caps</name>
    <description>CapsLock generates modifier Super.</description>
    </configItem>
    </option>
    <option>
    <configItem>
    <name>caps:hyper_caps</name>
    <description>CapsLock generates modifier Hyper.</description>
    </configItem>
    </option>

    to the <configItem>-entry for “caps” in /usr/share/X11/xkb/rules/base.xml.

    Calling

    setxkbmap –model pc105 –layout de –variant nodeadkeys –option caps:hyper_caps


    does not echo anything and returns 0.

    But if I check my key bindings with “xev”, I see my caps-key still generates the Caps_Lock keysym while Hyper_L is generated on my Fedora Core 5 box.

    Can anybody help?

    Thanks,
    Michael.

  2. #2
    Join Date
    Jul 2008
    Location
    London
    Posts
    459
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You seem to be altering an awful lot of files here! Have you tried just putting

    key <CAPS> {[ Hyper_L ]};

    in the appropriate language /symbols file? Entries in that file should over-ride those in the other sources used to assemble the driver.

  3. #3
    mischmitz Guest
    Yes, you are right, this works. But doing it this way I have to modify a keyboard variant, e.g. nodeadkeys, and anybody using this variant will get my remapping. What I was trying to achive is defining a layout option, which gives every user the choice to remap CAPS.

  4. #4
    mischmitz Guest
    Calling "setxkbmap -print" led me to the right way! Obviously the ruleset used is not "base", but "evdev".

    Here is how I managed to have two new options "caps:hyper_caps" and "caps:super_caps":

    First I added the following block to /usr/share/X11/xkb/symbols/capslock:

    partial modifier_keys
    xkb_symbols "super_caps" {
    key <CAPS> { [ Super_L ] };
    modifier_map Mod4 { Super_L };
    };


    partial modifier_keys
    xkb_symbols "hyper_caps" {
    key <CAPS> { [ Hyper_L ] };
    modifier_map Mod4 { Hyper_L };
    };

    Afterwards I added

    caps:super_caps CapsLock generates modifier Super.
    caps:hyper_caps CapsLock generates modifier Hyper.

    to the options section in usr/share/X11/xkb/rules/evdev.lst and

    <option>
    <configItem>
    <name>caps:super_caps</name>
    <description>CapsLock generates modifier Super.</description>
    </configItem>
    </option>
    <option>
    <configItem>
    <name>caps:hyper_caps</name>
    <description>CapsLock generates modifier Hyper.</description>
    </configItem>
    </option>

    to the <configItem>-entry for “caps” in /usr/share/X11/xkb/rules/evdev.xml and

    caps:super_caps = +capslock(super_caps)
    caps:hyper_caps = +capslock(hyper_caps)

    just following the line

    caps:swapescape = +capslock(swapescape)

    in /usr/share/X11/xkb/rules/evdev.

    Now calling

    setxkbmap –model pc105 –layout de –variant nodeadkeys –option caps:hyper_caps

    remaps CAPS to HYPER.

    When setting keyboard preferences via Gnome, there is are two new layout options in the "CapsLock key behaviour" menu.

  5. #5
    mischmitz Guest
    Sorry, I missed one point. I added

    --p----- -m------ capslock(super_caps)
    --p----- -m------ capslock(hyper_caps)

    to /usr/share/X11/xkb/symbols.dir just following the line

    h-p----- -m------ capslock(groupshift)

Similar Threads

  1. Win Modifier FC5
    By CardsRF in forum EOL (End Of Life) Versions
    Replies: 0
    Last Post: 3rd August 2006, 10:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •