Key remapping with modifier keys

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite
1












I have a US keyboard by I'm using a British keyboard layout.



The US keyboard doesn't physically have the keys (backslash) and | (vertical bar).



I'd like to remap them to Alt # and Alt ~ respectively.



How can I achieve this?



I'm running Ubuntu Artful, which uses xkb.







share|improve this question


























    up vote
    1
    down vote

    favorite
    1












    I have a US keyboard by I'm using a British keyboard layout.



    The US keyboard doesn't physically have the keys (backslash) and | (vertical bar).



    I'd like to remap them to Alt # and Alt ~ respectively.



    How can I achieve this?



    I'm running Ubuntu Artful, which uses xkb.







    share|improve this question
























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      I have a US keyboard by I'm using a British keyboard layout.



      The US keyboard doesn't physically have the keys (backslash) and | (vertical bar).



      I'd like to remap them to Alt # and Alt ~ respectively.



      How can I achieve this?



      I'm running Ubuntu Artful, which uses xkb.







      share|improve this question














      I have a US keyboard by I'm using a British keyboard layout.



      The US keyboard doesn't physically have the keys (backslash) and | (vertical bar).



      I'd like to remap them to Alt # and Alt ~ respectively.



      How can I achieve this?



      I'm running Ubuntu Artful, which uses xkb.









      share|improve this question













      share|improve this question




      share|improve this question








      edited May 5 at 15:42

























      asked May 4 at 14:32









      kYuZz

      1063




      1063




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          It's not crystal clear what you mean, but possibly you want to edit the /usr/share/X11/xkb/symbols/gb file and change the line



          key <BKSL> [numbersign, asciitilde, dead_grave, dead_breve ] ;


          to



          key <BKSL> [numbersign, asciitilde, backslash, bar ] ;


          Result:



          Right Alt + # =>



          Right Alt + Shift + # => |






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1032014%2fkey-remapping-with-modifier-keys%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            It's not crystal clear what you mean, but possibly you want to edit the /usr/share/X11/xkb/symbols/gb file and change the line



            key <BKSL> [numbersign, asciitilde, dead_grave, dead_breve ] ;


            to



            key <BKSL> [numbersign, asciitilde, backslash, bar ] ;


            Result:



            Right Alt + # =>



            Right Alt + Shift + # => |






            share|improve this answer
























              up vote
              1
              down vote













              It's not crystal clear what you mean, but possibly you want to edit the /usr/share/X11/xkb/symbols/gb file and change the line



              key <BKSL> [numbersign, asciitilde, dead_grave, dead_breve ] ;


              to



              key <BKSL> [numbersign, asciitilde, backslash, bar ] ;


              Result:



              Right Alt + # =>



              Right Alt + Shift + # => |






              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                It's not crystal clear what you mean, but possibly you want to edit the /usr/share/X11/xkb/symbols/gb file and change the line



                key <BKSL> [numbersign, asciitilde, dead_grave, dead_breve ] ;


                to



                key <BKSL> [numbersign, asciitilde, backslash, bar ] ;


                Result:



                Right Alt + # =>



                Right Alt + Shift + # => |






                share|improve this answer












                It's not crystal clear what you mean, but possibly you want to edit the /usr/share/X11/xkb/symbols/gb file and change the line



                key <BKSL> [numbersign, asciitilde, dead_grave, dead_breve ] ;


                to



                key <BKSL> [numbersign, asciitilde, backslash, bar ] ;


                Result:



                Right Alt + # =>



                Right Alt + Shift + # => |







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 4 at 15:26









                Gunnar Hjalmarsson

                17.7k23059




                17.7k23059






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1032014%2fkey-remapping-with-modifier-keys%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Trouble downloading packages list due to a “Hash sum mismatch” error

                    How do I move numbers in filenames, in a batch renaming operation?