What is the Mode_switch modifier for?












27















Playing with xmodmap I encountered a modifier key I hadn't heard of: Mode_switch. It seems to have something to do with inserting special characters.



I assigned it to a key but it seems to have no effect. What is it for? Is it different from ISO_Level3_Shift (Alt Gr)?










share|improve this question

























  • See also: unix.stackexchange.com/questions/249122/…

    – Pavel Šimerda
    Oct 1 '16 at 21:17


















27















Playing with xmodmap I encountered a modifier key I hadn't heard of: Mode_switch. It seems to have something to do with inserting special characters.



I assigned it to a key but it seems to have no effect. What is it for? Is it different from ISO_Level3_Shift (Alt Gr)?










share|improve this question

























  • See also: unix.stackexchange.com/questions/249122/…

    – Pavel Šimerda
    Oct 1 '16 at 21:17
















27












27








27


12






Playing with xmodmap I encountered a modifier key I hadn't heard of: Mode_switch. It seems to have something to do with inserting special characters.



I assigned it to a key but it seems to have no effect. What is it for? Is it different from ISO_Level3_Shift (Alt Gr)?










share|improve this question
















Playing with xmodmap I encountered a modifier key I hadn't heard of: Mode_switch. It seems to have something to do with inserting special characters.



I assigned it to a key but it seems to have no effect. What is it for? Is it different from ISO_Level3_Shift (Alt Gr)?







keyboard xmodmap special-characters






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:36









Community

1




1










asked Nov 7 '12 at 11:19









vemvvemv

1,23041520




1,23041520













  • See also: unix.stackexchange.com/questions/249122/…

    – Pavel Šimerda
    Oct 1 '16 at 21:17





















  • See also: unix.stackexchange.com/questions/249122/…

    – Pavel Šimerda
    Oct 1 '16 at 21:17



















See also: unix.stackexchange.com/questions/249122/…

– Pavel Šimerda
Oct 1 '16 at 21:17







See also: unix.stackexchange.com/questions/249122/…

– Pavel Šimerda
Oct 1 '16 at 21:17












3 Answers
3






active

oldest

votes


















27














Mode_switch is the old-style (pre-XKB) name of the key that is called AltGr on many keyboard layouts. It is similar to Shift, in that when you press a key that corresponds to a character, you get a different character if Shift or AltGr is also pressed. Unlike Shift, Mod_switch is not a modifier in the X11 sense because it normally applies to characters, not to function keys, so applications only need to perform a character lookup to obtain the desired effect.



ISO_Level3_Shift is the XKB version of this key. Generally speaking, XKB is a lot more complicated and can do some extra fancy stuff. XKB's mechanism is more general as it allows keyboard layouts to vary in which keys are influenced by which modifiers, it generalizes sticky (CapsLock-style) and simultaneous-press (Shift-style) modifiers and so on.






share|improve this answer
























  • Great to know that ISO_Level3_Shift can act 'stickily', I was looking for that functionality for a long while: unix.stackexchange.com/questions/39014/…

    – vemv
    Nov 7 '12 at 23:06











  • @Gilles So, are AltGr and Mode_switch the same keys? If not, in this link, they sound as if they are the same things. Could you clarify this a bit?

    – Utku
    Oct 18 '15 at 18:13











  • @Utku Mode_switch and ISO_Level3_Shift do the same thing in slightly different ways. I don't claim to understand the differences; most of the time they don't matter but I do remember that mixing xmodmap with XKB names occasionally caused modifiers not to work right.

    – Gilles
    Oct 18 '15 at 19:23











  • @Gilles I also don't understand the differences but I'm ending up either with us(cz_sk_de) features or with custom xmodmap mappings for some keys (comma for example) depending on whether AltGr is Mode_switch or ISO_Level3_Shift but can't get both features at the same time.

    – Pavel Šimerda
    Oct 1 '16 at 19:27






  • 1





    Sticky keys are not CapsLock-style. Sticky keys are called “latch” and lock-keys are called locks. Sticky keys are released after the next non-modifier is pressed while lock keys are in effect until they are pressed again.

    – Guildenstern
    Nov 10 '17 at 0:01



















10














This answer is not meant to contradict @Gilles' answer, but is meant to describe another aspect of xkb Input handling which I feel is "under-illuminated" in his answer.



You can use both ISO_Level3_Shift(Alt-Gr) and Mode_switch at the same time with different results. It requires some configuration, but you can have them both, and use them to produce 6 different keys per physical keyboard key!



You can e.g. configure Tab to be Mode_switch when held with xcape ⌂ and xmodmap, then e.g. the key labeled "H" on the keyboard could produce following characters/keys:



h
H
← (Cursor)
← (Symbol)


with H

with ShiftH

with AltGrH

with AltGrShiftH

with TabH

with TabShiftH



So, to come back around to your question: IL3S and Mode_switch can be configured to mean different things, so you can have cursor keys and ~200 useful characters from the (accented) languages, box-drawing, and technical character set on the 35 keys of the 3 letter rows.



To accomplish the above:



# Initial Setup
xmodmap -e 'keycode 23 = Mode_switch ISO_Left_Tab Tab ISO_Left_Tab Tab ISO_Left_Tab'
xmodmap -e 'keycode any = Tab'
xcape -e "Mode_switch=Tab"


example for H:



xmodmap -pke | grep 'h H'
# Make note of the keycode, note the 8 columns after the `=`,
# then edit and feed back into xmodmap with:
xmodmap -e 'keycode 43 = h H lowrightcorner uprightcorner Left leftarrow h H'





share|improve this answer


























  • Wow! I see what you mean in your 2nd last paragraph now, you just made my day 😉 I no longer need to copy and paste from htmlarrows.com to write things like fn: A → B.

    – Patrick McLaren
    Jan 13 '17 at 14:31











  • Why tab can not be other keys than iso_left_tab? For example, keycode 23 = Tab ISO_Left_Tab Next Next Next Next.

    – godblessfq
    Aug 11 '18 at 11:51











  • @godblessfq : I'm not quite sure, i understand what you are asking. Please create a new question, reference this answer, and @ me in a comment or the Question Text, then I'll see the question and try to help

    – Alex Stragies
    Aug 11 '18 at 17:26











  • I have asked the question here:unix.stackexchange.com/questions/461972/…

    – godblessfq
    Aug 12 '18 at 1:40





















1














Mode_shift in Xkb is a shift key for groups or layouts. If you have a
layout with multiple groups, you can hold down this key to access the
next group. If you have several layouts, you can hold down this key to
shift between layouts (†1).



So Mode_shift is to groups what Shift (or Shift_L and
Shift_R, to use the keysym names) is to levels.



This might become more clear if we consider that Mode_shift has an
alias called ISO_Group_Shift (†2). There are also keys called
ISO_Group_Latch and ISO_Group_Lock which correspond to
ISO_Level2_Latch (latch shift) and Shift_Lock, respectively (†3).



There are also a number of aliases for different scripts:




  • kana_switch

  • Arabic_switch

  • Greek_switch

  • Hebrew_switch

  • Hangul_switch


†1: This is based on my understanding of Xkb’s “groups” and “layouts”.
It seems that they are treated the same as far as selecting between them
with keys like this.



†2: I am basing this on the file keysymdef.h in this Git repository
at revision ab8666661fc6 (“Add XF86XK_AudioPreset”, 2017-05-10). On
installations you will probably find this file at
/usr/include/X11/keysymdef.h.



†3: There is also a key ISO_Lock, a kind of general-purpose lock key.



The meaning of the AltGr key



Gilles mentioned in his answer the connection with the
AltGr key:




Mode_switch is the old-style (pre-XKB) name of the key that is
called AltGr on many keyboard layouts.




That lead me to suspect that “AltGr” might stand for
“alternate/alternative group”, since Mode_switch is used to shift
groups. This turned out to be wrong, however. According to the
Wikipedia page on the AltGr key, “AltGr” seems to come from
IBM keyboards, and in their manuals it says that it is an abbreviation
for “alternate graphics”. This makes sense, since it seems likely that
using the keyboard to draw “graphics” (box-drawing characters used in
text user interfaces) came well before there was good support for
switching quickly between multiple scripts.






share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f55076%2fwhat-is-the-mode-switch-modifier-for%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    27














    Mode_switch is the old-style (pre-XKB) name of the key that is called AltGr on many keyboard layouts. It is similar to Shift, in that when you press a key that corresponds to a character, you get a different character if Shift or AltGr is also pressed. Unlike Shift, Mod_switch is not a modifier in the X11 sense because it normally applies to characters, not to function keys, so applications only need to perform a character lookup to obtain the desired effect.



    ISO_Level3_Shift is the XKB version of this key. Generally speaking, XKB is a lot more complicated and can do some extra fancy stuff. XKB's mechanism is more general as it allows keyboard layouts to vary in which keys are influenced by which modifiers, it generalizes sticky (CapsLock-style) and simultaneous-press (Shift-style) modifiers and so on.






    share|improve this answer
























    • Great to know that ISO_Level3_Shift can act 'stickily', I was looking for that functionality for a long while: unix.stackexchange.com/questions/39014/…

      – vemv
      Nov 7 '12 at 23:06











    • @Gilles So, are AltGr and Mode_switch the same keys? If not, in this link, they sound as if they are the same things. Could you clarify this a bit?

      – Utku
      Oct 18 '15 at 18:13











    • @Utku Mode_switch and ISO_Level3_Shift do the same thing in slightly different ways. I don't claim to understand the differences; most of the time they don't matter but I do remember that mixing xmodmap with XKB names occasionally caused modifiers not to work right.

      – Gilles
      Oct 18 '15 at 19:23











    • @Gilles I also don't understand the differences but I'm ending up either with us(cz_sk_de) features or with custom xmodmap mappings for some keys (comma for example) depending on whether AltGr is Mode_switch or ISO_Level3_Shift but can't get both features at the same time.

      – Pavel Šimerda
      Oct 1 '16 at 19:27






    • 1





      Sticky keys are not CapsLock-style. Sticky keys are called “latch” and lock-keys are called locks. Sticky keys are released after the next non-modifier is pressed while lock keys are in effect until they are pressed again.

      – Guildenstern
      Nov 10 '17 at 0:01
















    27














    Mode_switch is the old-style (pre-XKB) name of the key that is called AltGr on many keyboard layouts. It is similar to Shift, in that when you press a key that corresponds to a character, you get a different character if Shift or AltGr is also pressed. Unlike Shift, Mod_switch is not a modifier in the X11 sense because it normally applies to characters, not to function keys, so applications only need to perform a character lookup to obtain the desired effect.



    ISO_Level3_Shift is the XKB version of this key. Generally speaking, XKB is a lot more complicated and can do some extra fancy stuff. XKB's mechanism is more general as it allows keyboard layouts to vary in which keys are influenced by which modifiers, it generalizes sticky (CapsLock-style) and simultaneous-press (Shift-style) modifiers and so on.






    share|improve this answer
























    • Great to know that ISO_Level3_Shift can act 'stickily', I was looking for that functionality for a long while: unix.stackexchange.com/questions/39014/…

      – vemv
      Nov 7 '12 at 23:06











    • @Gilles So, are AltGr and Mode_switch the same keys? If not, in this link, they sound as if they are the same things. Could you clarify this a bit?

      – Utku
      Oct 18 '15 at 18:13











    • @Utku Mode_switch and ISO_Level3_Shift do the same thing in slightly different ways. I don't claim to understand the differences; most of the time they don't matter but I do remember that mixing xmodmap with XKB names occasionally caused modifiers not to work right.

      – Gilles
      Oct 18 '15 at 19:23











    • @Gilles I also don't understand the differences but I'm ending up either with us(cz_sk_de) features or with custom xmodmap mappings for some keys (comma for example) depending on whether AltGr is Mode_switch or ISO_Level3_Shift but can't get both features at the same time.

      – Pavel Šimerda
      Oct 1 '16 at 19:27






    • 1





      Sticky keys are not CapsLock-style. Sticky keys are called “latch” and lock-keys are called locks. Sticky keys are released after the next non-modifier is pressed while lock keys are in effect until they are pressed again.

      – Guildenstern
      Nov 10 '17 at 0:01














    27












    27








    27







    Mode_switch is the old-style (pre-XKB) name of the key that is called AltGr on many keyboard layouts. It is similar to Shift, in that when you press a key that corresponds to a character, you get a different character if Shift or AltGr is also pressed. Unlike Shift, Mod_switch is not a modifier in the X11 sense because it normally applies to characters, not to function keys, so applications only need to perform a character lookup to obtain the desired effect.



    ISO_Level3_Shift is the XKB version of this key. Generally speaking, XKB is a lot more complicated and can do some extra fancy stuff. XKB's mechanism is more general as it allows keyboard layouts to vary in which keys are influenced by which modifiers, it generalizes sticky (CapsLock-style) and simultaneous-press (Shift-style) modifiers and so on.






    share|improve this answer













    Mode_switch is the old-style (pre-XKB) name of the key that is called AltGr on many keyboard layouts. It is similar to Shift, in that when you press a key that corresponds to a character, you get a different character if Shift or AltGr is also pressed. Unlike Shift, Mod_switch is not a modifier in the X11 sense because it normally applies to characters, not to function keys, so applications only need to perform a character lookup to obtain the desired effect.



    ISO_Level3_Shift is the XKB version of this key. Generally speaking, XKB is a lot more complicated and can do some extra fancy stuff. XKB's mechanism is more general as it allows keyboard layouts to vary in which keys are influenced by which modifiers, it generalizes sticky (CapsLock-style) and simultaneous-press (Shift-style) modifiers and so on.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 7 '12 at 22:59









    GillesGilles

    545k12911071623




    545k12911071623













    • Great to know that ISO_Level3_Shift can act 'stickily', I was looking for that functionality for a long while: unix.stackexchange.com/questions/39014/…

      – vemv
      Nov 7 '12 at 23:06











    • @Gilles So, are AltGr and Mode_switch the same keys? If not, in this link, they sound as if they are the same things. Could you clarify this a bit?

      – Utku
      Oct 18 '15 at 18:13











    • @Utku Mode_switch and ISO_Level3_Shift do the same thing in slightly different ways. I don't claim to understand the differences; most of the time they don't matter but I do remember that mixing xmodmap with XKB names occasionally caused modifiers not to work right.

      – Gilles
      Oct 18 '15 at 19:23











    • @Gilles I also don't understand the differences but I'm ending up either with us(cz_sk_de) features or with custom xmodmap mappings for some keys (comma for example) depending on whether AltGr is Mode_switch or ISO_Level3_Shift but can't get both features at the same time.

      – Pavel Šimerda
      Oct 1 '16 at 19:27






    • 1





      Sticky keys are not CapsLock-style. Sticky keys are called “latch” and lock-keys are called locks. Sticky keys are released after the next non-modifier is pressed while lock keys are in effect until they are pressed again.

      – Guildenstern
      Nov 10 '17 at 0:01



















    • Great to know that ISO_Level3_Shift can act 'stickily', I was looking for that functionality for a long while: unix.stackexchange.com/questions/39014/…

      – vemv
      Nov 7 '12 at 23:06











    • @Gilles So, are AltGr and Mode_switch the same keys? If not, in this link, they sound as if they are the same things. Could you clarify this a bit?

      – Utku
      Oct 18 '15 at 18:13











    • @Utku Mode_switch and ISO_Level3_Shift do the same thing in slightly different ways. I don't claim to understand the differences; most of the time they don't matter but I do remember that mixing xmodmap with XKB names occasionally caused modifiers not to work right.

      – Gilles
      Oct 18 '15 at 19:23











    • @Gilles I also don't understand the differences but I'm ending up either with us(cz_sk_de) features or with custom xmodmap mappings for some keys (comma for example) depending on whether AltGr is Mode_switch or ISO_Level3_Shift but can't get both features at the same time.

      – Pavel Šimerda
      Oct 1 '16 at 19:27






    • 1





      Sticky keys are not CapsLock-style. Sticky keys are called “latch” and lock-keys are called locks. Sticky keys are released after the next non-modifier is pressed while lock keys are in effect until they are pressed again.

      – Guildenstern
      Nov 10 '17 at 0:01

















    Great to know that ISO_Level3_Shift can act 'stickily', I was looking for that functionality for a long while: unix.stackexchange.com/questions/39014/…

    – vemv
    Nov 7 '12 at 23:06





    Great to know that ISO_Level3_Shift can act 'stickily', I was looking for that functionality for a long while: unix.stackexchange.com/questions/39014/…

    – vemv
    Nov 7 '12 at 23:06













    @Gilles So, are AltGr and Mode_switch the same keys? If not, in this link, they sound as if they are the same things. Could you clarify this a bit?

    – Utku
    Oct 18 '15 at 18:13





    @Gilles So, are AltGr and Mode_switch the same keys? If not, in this link, they sound as if they are the same things. Could you clarify this a bit?

    – Utku
    Oct 18 '15 at 18:13













    @Utku Mode_switch and ISO_Level3_Shift do the same thing in slightly different ways. I don't claim to understand the differences; most of the time they don't matter but I do remember that mixing xmodmap with XKB names occasionally caused modifiers not to work right.

    – Gilles
    Oct 18 '15 at 19:23





    @Utku Mode_switch and ISO_Level3_Shift do the same thing in slightly different ways. I don't claim to understand the differences; most of the time they don't matter but I do remember that mixing xmodmap with XKB names occasionally caused modifiers not to work right.

    – Gilles
    Oct 18 '15 at 19:23













    @Gilles I also don't understand the differences but I'm ending up either with us(cz_sk_de) features or with custom xmodmap mappings for some keys (comma for example) depending on whether AltGr is Mode_switch or ISO_Level3_Shift but can't get both features at the same time.

    – Pavel Šimerda
    Oct 1 '16 at 19:27





    @Gilles I also don't understand the differences but I'm ending up either with us(cz_sk_de) features or with custom xmodmap mappings for some keys (comma for example) depending on whether AltGr is Mode_switch or ISO_Level3_Shift but can't get both features at the same time.

    – Pavel Šimerda
    Oct 1 '16 at 19:27




    1




    1





    Sticky keys are not CapsLock-style. Sticky keys are called “latch” and lock-keys are called locks. Sticky keys are released after the next non-modifier is pressed while lock keys are in effect until they are pressed again.

    – Guildenstern
    Nov 10 '17 at 0:01





    Sticky keys are not CapsLock-style. Sticky keys are called “latch” and lock-keys are called locks. Sticky keys are released after the next non-modifier is pressed while lock keys are in effect until they are pressed again.

    – Guildenstern
    Nov 10 '17 at 0:01













    10














    This answer is not meant to contradict @Gilles' answer, but is meant to describe another aspect of xkb Input handling which I feel is "under-illuminated" in his answer.



    You can use both ISO_Level3_Shift(Alt-Gr) and Mode_switch at the same time with different results. It requires some configuration, but you can have them both, and use them to produce 6 different keys per physical keyboard key!



    You can e.g. configure Tab to be Mode_switch when held with xcape ⌂ and xmodmap, then e.g. the key labeled "H" on the keyboard could produce following characters/keys:



    h
    H
    ← (Cursor)
    ← (Symbol)


    with H

    with ShiftH

    with AltGrH

    with AltGrShiftH

    with TabH

    with TabShiftH



    So, to come back around to your question: IL3S and Mode_switch can be configured to mean different things, so you can have cursor keys and ~200 useful characters from the (accented) languages, box-drawing, and technical character set on the 35 keys of the 3 letter rows.



    To accomplish the above:



    # Initial Setup
    xmodmap -e 'keycode 23 = Mode_switch ISO_Left_Tab Tab ISO_Left_Tab Tab ISO_Left_Tab'
    xmodmap -e 'keycode any = Tab'
    xcape -e "Mode_switch=Tab"


    example for H:



    xmodmap -pke | grep 'h H'
    # Make note of the keycode, note the 8 columns after the `=`,
    # then edit and feed back into xmodmap with:
    xmodmap -e 'keycode 43 = h H lowrightcorner uprightcorner Left leftarrow h H'





    share|improve this answer


























    • Wow! I see what you mean in your 2nd last paragraph now, you just made my day 😉 I no longer need to copy and paste from htmlarrows.com to write things like fn: A → B.

      – Patrick McLaren
      Jan 13 '17 at 14:31











    • Why tab can not be other keys than iso_left_tab? For example, keycode 23 = Tab ISO_Left_Tab Next Next Next Next.

      – godblessfq
      Aug 11 '18 at 11:51











    • @godblessfq : I'm not quite sure, i understand what you are asking. Please create a new question, reference this answer, and @ me in a comment or the Question Text, then I'll see the question and try to help

      – Alex Stragies
      Aug 11 '18 at 17:26











    • I have asked the question here:unix.stackexchange.com/questions/461972/…

      – godblessfq
      Aug 12 '18 at 1:40


















    10














    This answer is not meant to contradict @Gilles' answer, but is meant to describe another aspect of xkb Input handling which I feel is "under-illuminated" in his answer.



    You can use both ISO_Level3_Shift(Alt-Gr) and Mode_switch at the same time with different results. It requires some configuration, but you can have them both, and use them to produce 6 different keys per physical keyboard key!



    You can e.g. configure Tab to be Mode_switch when held with xcape ⌂ and xmodmap, then e.g. the key labeled "H" on the keyboard could produce following characters/keys:



    h
    H
    ← (Cursor)
    ← (Symbol)


    with H

    with ShiftH

    with AltGrH

    with AltGrShiftH

    with TabH

    with TabShiftH



    So, to come back around to your question: IL3S and Mode_switch can be configured to mean different things, so you can have cursor keys and ~200 useful characters from the (accented) languages, box-drawing, and technical character set on the 35 keys of the 3 letter rows.



    To accomplish the above:



    # Initial Setup
    xmodmap -e 'keycode 23 = Mode_switch ISO_Left_Tab Tab ISO_Left_Tab Tab ISO_Left_Tab'
    xmodmap -e 'keycode any = Tab'
    xcape -e "Mode_switch=Tab"


    example for H:



    xmodmap -pke | grep 'h H'
    # Make note of the keycode, note the 8 columns after the `=`,
    # then edit and feed back into xmodmap with:
    xmodmap -e 'keycode 43 = h H lowrightcorner uprightcorner Left leftarrow h H'





    share|improve this answer


























    • Wow! I see what you mean in your 2nd last paragraph now, you just made my day 😉 I no longer need to copy and paste from htmlarrows.com to write things like fn: A → B.

      – Patrick McLaren
      Jan 13 '17 at 14:31











    • Why tab can not be other keys than iso_left_tab? For example, keycode 23 = Tab ISO_Left_Tab Next Next Next Next.

      – godblessfq
      Aug 11 '18 at 11:51











    • @godblessfq : I'm not quite sure, i understand what you are asking. Please create a new question, reference this answer, and @ me in a comment or the Question Text, then I'll see the question and try to help

      – Alex Stragies
      Aug 11 '18 at 17:26











    • I have asked the question here:unix.stackexchange.com/questions/461972/…

      – godblessfq
      Aug 12 '18 at 1:40
















    10












    10








    10







    This answer is not meant to contradict @Gilles' answer, but is meant to describe another aspect of xkb Input handling which I feel is "under-illuminated" in his answer.



    You can use both ISO_Level3_Shift(Alt-Gr) and Mode_switch at the same time with different results. It requires some configuration, but you can have them both, and use them to produce 6 different keys per physical keyboard key!



    You can e.g. configure Tab to be Mode_switch when held with xcape ⌂ and xmodmap, then e.g. the key labeled "H" on the keyboard could produce following characters/keys:



    h
    H
    ← (Cursor)
    ← (Symbol)


    with H

    with ShiftH

    with AltGrH

    with AltGrShiftH

    with TabH

    with TabShiftH



    So, to come back around to your question: IL3S and Mode_switch can be configured to mean different things, so you can have cursor keys and ~200 useful characters from the (accented) languages, box-drawing, and technical character set on the 35 keys of the 3 letter rows.



    To accomplish the above:



    # Initial Setup
    xmodmap -e 'keycode 23 = Mode_switch ISO_Left_Tab Tab ISO_Left_Tab Tab ISO_Left_Tab'
    xmodmap -e 'keycode any = Tab'
    xcape -e "Mode_switch=Tab"


    example for H:



    xmodmap -pke | grep 'h H'
    # Make note of the keycode, note the 8 columns after the `=`,
    # then edit and feed back into xmodmap with:
    xmodmap -e 'keycode 43 = h H lowrightcorner uprightcorner Left leftarrow h H'





    share|improve this answer















    This answer is not meant to contradict @Gilles' answer, but is meant to describe another aspect of xkb Input handling which I feel is "under-illuminated" in his answer.



    You can use both ISO_Level3_Shift(Alt-Gr) and Mode_switch at the same time with different results. It requires some configuration, but you can have them both, and use them to produce 6 different keys per physical keyboard key!



    You can e.g. configure Tab to be Mode_switch when held with xcape ⌂ and xmodmap, then e.g. the key labeled "H" on the keyboard could produce following characters/keys:



    h
    H
    ← (Cursor)
    ← (Symbol)


    with H

    with ShiftH

    with AltGrH

    with AltGrShiftH

    with TabH

    with TabShiftH



    So, to come back around to your question: IL3S and Mode_switch can be configured to mean different things, so you can have cursor keys and ~200 useful characters from the (accented) languages, box-drawing, and technical character set on the 35 keys of the 3 letter rows.



    To accomplish the above:



    # Initial Setup
    xmodmap -e 'keycode 23 = Mode_switch ISO_Left_Tab Tab ISO_Left_Tab Tab ISO_Left_Tab'
    xmodmap -e 'keycode any = Tab'
    xcape -e "Mode_switch=Tab"


    example for H:



    xmodmap -pke | grep 'h H'
    # Make note of the keycode, note the 8 columns after the `=`,
    # then edit and feed back into xmodmap with:
    xmodmap -e 'keycode 43 = h H lowrightcorner uprightcorner Left leftarrow h H'






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 22 '17 at 14:20

























    answered Nov 26 '16 at 21:20









    Alex StragiesAlex Stragies

    3,4001640




    3,4001640













    • Wow! I see what you mean in your 2nd last paragraph now, you just made my day 😉 I no longer need to copy and paste from htmlarrows.com to write things like fn: A → B.

      – Patrick McLaren
      Jan 13 '17 at 14:31











    • Why tab can not be other keys than iso_left_tab? For example, keycode 23 = Tab ISO_Left_Tab Next Next Next Next.

      – godblessfq
      Aug 11 '18 at 11:51











    • @godblessfq : I'm not quite sure, i understand what you are asking. Please create a new question, reference this answer, and @ me in a comment or the Question Text, then I'll see the question and try to help

      – Alex Stragies
      Aug 11 '18 at 17:26











    • I have asked the question here:unix.stackexchange.com/questions/461972/…

      – godblessfq
      Aug 12 '18 at 1:40





















    • Wow! I see what you mean in your 2nd last paragraph now, you just made my day 😉 I no longer need to copy and paste from htmlarrows.com to write things like fn: A → B.

      – Patrick McLaren
      Jan 13 '17 at 14:31











    • Why tab can not be other keys than iso_left_tab? For example, keycode 23 = Tab ISO_Left_Tab Next Next Next Next.

      – godblessfq
      Aug 11 '18 at 11:51











    • @godblessfq : I'm not quite sure, i understand what you are asking. Please create a new question, reference this answer, and @ me in a comment or the Question Text, then I'll see the question and try to help

      – Alex Stragies
      Aug 11 '18 at 17:26











    • I have asked the question here:unix.stackexchange.com/questions/461972/…

      – godblessfq
      Aug 12 '18 at 1:40



















    Wow! I see what you mean in your 2nd last paragraph now, you just made my day 😉 I no longer need to copy and paste from htmlarrows.com to write things like fn: A → B.

    – Patrick McLaren
    Jan 13 '17 at 14:31





    Wow! I see what you mean in your 2nd last paragraph now, you just made my day 😉 I no longer need to copy and paste from htmlarrows.com to write things like fn: A → B.

    – Patrick McLaren
    Jan 13 '17 at 14:31













    Why tab can not be other keys than iso_left_tab? For example, keycode 23 = Tab ISO_Left_Tab Next Next Next Next.

    – godblessfq
    Aug 11 '18 at 11:51





    Why tab can not be other keys than iso_left_tab? For example, keycode 23 = Tab ISO_Left_Tab Next Next Next Next.

    – godblessfq
    Aug 11 '18 at 11:51













    @godblessfq : I'm not quite sure, i understand what you are asking. Please create a new question, reference this answer, and @ me in a comment or the Question Text, then I'll see the question and try to help

    – Alex Stragies
    Aug 11 '18 at 17:26





    @godblessfq : I'm not quite sure, i understand what you are asking. Please create a new question, reference this answer, and @ me in a comment or the Question Text, then I'll see the question and try to help

    – Alex Stragies
    Aug 11 '18 at 17:26













    I have asked the question here:unix.stackexchange.com/questions/461972/…

    – godblessfq
    Aug 12 '18 at 1:40







    I have asked the question here:unix.stackexchange.com/questions/461972/…

    – godblessfq
    Aug 12 '18 at 1:40













    1














    Mode_shift in Xkb is a shift key for groups or layouts. If you have a
    layout with multiple groups, you can hold down this key to access the
    next group. If you have several layouts, you can hold down this key to
    shift between layouts (†1).



    So Mode_shift is to groups what Shift (or Shift_L and
    Shift_R, to use the keysym names) is to levels.



    This might become more clear if we consider that Mode_shift has an
    alias called ISO_Group_Shift (†2). There are also keys called
    ISO_Group_Latch and ISO_Group_Lock which correspond to
    ISO_Level2_Latch (latch shift) and Shift_Lock, respectively (†3).



    There are also a number of aliases for different scripts:




    • kana_switch

    • Arabic_switch

    • Greek_switch

    • Hebrew_switch

    • Hangul_switch


    †1: This is based on my understanding of Xkb’s “groups” and “layouts”.
    It seems that they are treated the same as far as selecting between them
    with keys like this.



    †2: I am basing this on the file keysymdef.h in this Git repository
    at revision ab8666661fc6 (“Add XF86XK_AudioPreset”, 2017-05-10). On
    installations you will probably find this file at
    /usr/include/X11/keysymdef.h.



    †3: There is also a key ISO_Lock, a kind of general-purpose lock key.



    The meaning of the AltGr key



    Gilles mentioned in his answer the connection with the
    AltGr key:




    Mode_switch is the old-style (pre-XKB) name of the key that is
    called AltGr on many keyboard layouts.




    That lead me to suspect that “AltGr” might stand for
    “alternate/alternative group”, since Mode_switch is used to shift
    groups. This turned out to be wrong, however. According to the
    Wikipedia page on the AltGr key, “AltGr” seems to come from
    IBM keyboards, and in their manuals it says that it is an abbreviation
    for “alternate graphics”. This makes sense, since it seems likely that
    using the keyboard to draw “graphics” (box-drawing characters used in
    text user interfaces) came well before there was good support for
    switching quickly between multiple scripts.






    share|improve this answer






























      1














      Mode_shift in Xkb is a shift key for groups or layouts. If you have a
      layout with multiple groups, you can hold down this key to access the
      next group. If you have several layouts, you can hold down this key to
      shift between layouts (†1).



      So Mode_shift is to groups what Shift (or Shift_L and
      Shift_R, to use the keysym names) is to levels.



      This might become more clear if we consider that Mode_shift has an
      alias called ISO_Group_Shift (†2). There are also keys called
      ISO_Group_Latch and ISO_Group_Lock which correspond to
      ISO_Level2_Latch (latch shift) and Shift_Lock, respectively (†3).



      There are also a number of aliases for different scripts:




      • kana_switch

      • Arabic_switch

      • Greek_switch

      • Hebrew_switch

      • Hangul_switch


      †1: This is based on my understanding of Xkb’s “groups” and “layouts”.
      It seems that they are treated the same as far as selecting between them
      with keys like this.



      †2: I am basing this on the file keysymdef.h in this Git repository
      at revision ab8666661fc6 (“Add XF86XK_AudioPreset”, 2017-05-10). On
      installations you will probably find this file at
      /usr/include/X11/keysymdef.h.



      †3: There is also a key ISO_Lock, a kind of general-purpose lock key.



      The meaning of the AltGr key



      Gilles mentioned in his answer the connection with the
      AltGr key:




      Mode_switch is the old-style (pre-XKB) name of the key that is
      called AltGr on many keyboard layouts.




      That lead me to suspect that “AltGr” might stand for
      “alternate/alternative group”, since Mode_switch is used to shift
      groups. This turned out to be wrong, however. According to the
      Wikipedia page on the AltGr key, “AltGr” seems to come from
      IBM keyboards, and in their manuals it says that it is an abbreviation
      for “alternate graphics”. This makes sense, since it seems likely that
      using the keyboard to draw “graphics” (box-drawing characters used in
      text user interfaces) came well before there was good support for
      switching quickly between multiple scripts.






      share|improve this answer




























        1












        1








        1







        Mode_shift in Xkb is a shift key for groups or layouts. If you have a
        layout with multiple groups, you can hold down this key to access the
        next group. If you have several layouts, you can hold down this key to
        shift between layouts (†1).



        So Mode_shift is to groups what Shift (or Shift_L and
        Shift_R, to use the keysym names) is to levels.



        This might become more clear if we consider that Mode_shift has an
        alias called ISO_Group_Shift (†2). There are also keys called
        ISO_Group_Latch and ISO_Group_Lock which correspond to
        ISO_Level2_Latch (latch shift) and Shift_Lock, respectively (†3).



        There are also a number of aliases for different scripts:




        • kana_switch

        • Arabic_switch

        • Greek_switch

        • Hebrew_switch

        • Hangul_switch


        †1: This is based on my understanding of Xkb’s “groups” and “layouts”.
        It seems that they are treated the same as far as selecting between them
        with keys like this.



        †2: I am basing this on the file keysymdef.h in this Git repository
        at revision ab8666661fc6 (“Add XF86XK_AudioPreset”, 2017-05-10). On
        installations you will probably find this file at
        /usr/include/X11/keysymdef.h.



        †3: There is also a key ISO_Lock, a kind of general-purpose lock key.



        The meaning of the AltGr key



        Gilles mentioned in his answer the connection with the
        AltGr key:




        Mode_switch is the old-style (pre-XKB) name of the key that is
        called AltGr on many keyboard layouts.




        That lead me to suspect that “AltGr” might stand for
        “alternate/alternative group”, since Mode_switch is used to shift
        groups. This turned out to be wrong, however. According to the
        Wikipedia page on the AltGr key, “AltGr” seems to come from
        IBM keyboards, and in their manuals it says that it is an abbreviation
        for “alternate graphics”. This makes sense, since it seems likely that
        using the keyboard to draw “graphics” (box-drawing characters used in
        text user interfaces) came well before there was good support for
        switching quickly between multiple scripts.






        share|improve this answer















        Mode_shift in Xkb is a shift key for groups or layouts. If you have a
        layout with multiple groups, you can hold down this key to access the
        next group. If you have several layouts, you can hold down this key to
        shift between layouts (†1).



        So Mode_shift is to groups what Shift (or Shift_L and
        Shift_R, to use the keysym names) is to levels.



        This might become more clear if we consider that Mode_shift has an
        alias called ISO_Group_Shift (†2). There are also keys called
        ISO_Group_Latch and ISO_Group_Lock which correspond to
        ISO_Level2_Latch (latch shift) and Shift_Lock, respectively (†3).



        There are also a number of aliases for different scripts:




        • kana_switch

        • Arabic_switch

        • Greek_switch

        • Hebrew_switch

        • Hangul_switch


        †1: This is based on my understanding of Xkb’s “groups” and “layouts”.
        It seems that they are treated the same as far as selecting between them
        with keys like this.



        †2: I am basing this on the file keysymdef.h in this Git repository
        at revision ab8666661fc6 (“Add XF86XK_AudioPreset”, 2017-05-10). On
        installations you will probably find this file at
        /usr/include/X11/keysymdef.h.



        †3: There is also a key ISO_Lock, a kind of general-purpose lock key.



        The meaning of the AltGr key



        Gilles mentioned in his answer the connection with the
        AltGr key:




        Mode_switch is the old-style (pre-XKB) name of the key that is
        called AltGr on many keyboard layouts.




        That lead me to suspect that “AltGr” might stand for
        “alternate/alternative group”, since Mode_switch is used to shift
        groups. This turned out to be wrong, however. According to the
        Wikipedia page on the AltGr key, “AltGr” seems to come from
        IBM keyboards, and in their manuals it says that it is an abbreviation
        for “alternate graphics”. This makes sense, since it seems likely that
        using the keyboard to draw “graphics” (box-drawing characters used in
        text user interfaces) came well before there was good support for
        switching quickly between multiple scripts.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 7 at 21:40

























        answered Nov 10 '17 at 12:35









        GuildensternGuildenstern

        1736




        1736






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f55076%2fwhat-is-the-mode-switch-modifier-for%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?