Disabling middle mouse button












14















So I tried looking through the various other questions but they mostly focus on disabling the middle mouse paste.



Basically the middle mouse button on my Logitech G500s is broken, and it keeps "clicking" randomly so it's screwing up any chance of doing work.



Is there any way to disable it? Or map it to nothing?



Thanks and sorry if this is a duplicate.



xinput list output:



⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Turtle Beach Turtle Beach PX3 (XBOX) id=8 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=9 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=10 [slave pointer (2)]
⎜ ↳ Razer Razer DeathStalker id=12 [slave pointer (2)]
⎜ ↳ Razer Razer DeathStalker id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Razer Razer DeathStalker id=11 [slave keyboard (3)]









share|improve this question

























  • Execute this command xinput list | grep 'id=' and post the output.

    – Helio
    Mar 15 '15 at 13:36











  • For this mouse, there are two device ID's for this mouse. After running xinput test 9, the id of my mouse middle button is 2

    – Tom Hamilton Stubber
    Mar 15 '15 at 13:42


















14















So I tried looking through the various other questions but they mostly focus on disabling the middle mouse paste.



Basically the middle mouse button on my Logitech G500s is broken, and it keeps "clicking" randomly so it's screwing up any chance of doing work.



Is there any way to disable it? Or map it to nothing?



Thanks and sorry if this is a duplicate.



xinput list output:



⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Turtle Beach Turtle Beach PX3 (XBOX) id=8 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=9 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=10 [slave pointer (2)]
⎜ ↳ Razer Razer DeathStalker id=12 [slave pointer (2)]
⎜ ↳ Razer Razer DeathStalker id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Razer Razer DeathStalker id=11 [slave keyboard (3)]









share|improve this question

























  • Execute this command xinput list | grep 'id=' and post the output.

    – Helio
    Mar 15 '15 at 13:36











  • For this mouse, there are two device ID's for this mouse. After running xinput test 9, the id of my mouse middle button is 2

    – Tom Hamilton Stubber
    Mar 15 '15 at 13:42
















14












14








14


5






So I tried looking through the various other questions but they mostly focus on disabling the middle mouse paste.



Basically the middle mouse button on my Logitech G500s is broken, and it keeps "clicking" randomly so it's screwing up any chance of doing work.



Is there any way to disable it? Or map it to nothing?



Thanks and sorry if this is a duplicate.



xinput list output:



⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Turtle Beach Turtle Beach PX3 (XBOX) id=8 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=9 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=10 [slave pointer (2)]
⎜ ↳ Razer Razer DeathStalker id=12 [slave pointer (2)]
⎜ ↳ Razer Razer DeathStalker id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Razer Razer DeathStalker id=11 [slave keyboard (3)]









share|improve this question
















So I tried looking through the various other questions but they mostly focus on disabling the middle mouse paste.



Basically the middle mouse button on my Logitech G500s is broken, and it keeps "clicking" randomly so it's screwing up any chance of doing work.



Is there any way to disable it? Or map it to nothing?



Thanks and sorry if this is a duplicate.



xinput list output:



⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Turtle Beach Turtle Beach PX3 (XBOX) id=8 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=9 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=10 [slave pointer (2)]
⎜ ↳ Razer Razer DeathStalker id=12 [slave pointer (2)]
⎜ ↳ Razer Razer DeathStalker id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Razer Razer DeathStalker id=11 [slave keyboard (3)]






mouse






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 16 '15 at 15:59









P.-H. Lin

2,4431918




2,4431918










asked Mar 15 '15 at 13:28









Tom Hamilton StubberTom Hamilton Stubber

7314




7314













  • Execute this command xinput list | grep 'id=' and post the output.

    – Helio
    Mar 15 '15 at 13:36











  • For this mouse, there are two device ID's for this mouse. After running xinput test 9, the id of my mouse middle button is 2

    – Tom Hamilton Stubber
    Mar 15 '15 at 13:42





















  • Execute this command xinput list | grep 'id=' and post the output.

    – Helio
    Mar 15 '15 at 13:36











  • For this mouse, there are two device ID's for this mouse. After running xinput test 9, the id of my mouse middle button is 2

    – Tom Hamilton Stubber
    Mar 15 '15 at 13:42



















Execute this command xinput list | grep 'id=' and post the output.

– Helio
Mar 15 '15 at 13:36





Execute this command xinput list | grep 'id=' and post the output.

– Helio
Mar 15 '15 at 13:36













For this mouse, there are two device ID's for this mouse. After running xinput test 9, the id of my mouse middle button is 2

– Tom Hamilton Stubber
Mar 15 '15 at 13:42







For this mouse, there are two device ID's for this mouse. After running xinput test 9, the id of my mouse middle button is 2

– Tom Hamilton Stubber
Mar 15 '15 at 13:42












2 Answers
2






active

oldest

votes


















19














Execute those commands:



xinput set-button-map 9 1 0 3
xinput set-button-map 10 1 0 3



Explaination (kindly donated by @Yehosef):



The first number is the id of the pointer (you'll often only have one, in this case there were two, 9 and 10).



The next numbers are what you do with the first, second, and third (ie, left, middle, right) mouse buttons. The "1 0 3" tells it that the left button should do a left click (action 1), the middle button should do nothing, and the right button should do a right click (action 3). If you want to make the middle button also do a left click you could use "1 1 3". If you wanted to switch the right and left actions you could use "3 0 1". See https://wiki.ubuntu.com/X/Config/Input for more info.






share|improve this answer


























  • Thanks a lot, trying to look this up was getting very frustrating.

    – Tom Hamilton Stubber
    Mar 15 '15 at 13:46






  • 1





    Thanks! For those wondering - the 9/10 are the input id of the mouse and the 1 0 3 are the mappings for the first, second, and third mouse buttons. If you wanted all buttons to do the same thing you could use 1 1 1 or if you want to switch the right and left buttons you could use 3 0 1.

    – Yehosef
    Jul 26 '16 at 8:03













  • @Yehosef: Thanks! I did not explain what is happening when the OP ran the commands. Please create a new detailed answer, ping me and I'll upvote. This is an interesting explaination.

    – Helio
    Jul 26 '16 at 20:13













  • @Helio I don't have a different answer - just more explanation for those interested. Perhaps you want to edit your answer to include this info you can. I was thinking about editing your answer - but I generally don't like it when people add extra details to my answers - so I refrained :)

    – Yehosef
    Jul 27 '16 at 11:15






  • 2





    So how do I determine the first number. I run xinput list | grep 'id=' and look for the things that looks most like my mouse/touchpad? Any definitive way of telling whether it is the right one?

    – Kvothe
    Jul 24 '18 at 21:15



















1














Following instructions are based on info at Ubuntu Wiki
(Scroll down to title "Example: Disabling middle-mouse button paste on a scrollwheel mouse").



First, determine id of the pointer by listing input devices:



xinput list | grep 'id='


And look for the line that contains name of your pointer, there also should be id of the device, right after "id=". For example, id of this device is 10:



Lenovo ThinkPad Compact USB Keyboard with TrackPoint    id=10   [slave  pointer  (2)]


Next, get current button map of that device (I'll be using id of my device, which is 10):



xinput get-button-map 10


Output:



1 2 3 4 5 6 7 8 9


This is mapping of pointer buttons to actions, where number represents action code, and position - button.



We're interested in second map - number 2 corresponds to action "Middle Button Click" and the position of it - to actual middle button.



To disable middle button triggering any action, I'd use command xinput set-button-map with id of the device and updated map (new action code is 0 - no action). No need to put whole map - map till interested button suffice (the rest just won't be updated):



 xinput set-button-map 10 1 0


That's it.






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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2faskubuntu.com%2fquestions%2f597064%2fdisabling-middle-mouse-button%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    19














    Execute those commands:



    xinput set-button-map 9 1 0 3
    xinput set-button-map 10 1 0 3



    Explaination (kindly donated by @Yehosef):



    The first number is the id of the pointer (you'll often only have one, in this case there were two, 9 and 10).



    The next numbers are what you do with the first, second, and third (ie, left, middle, right) mouse buttons. The "1 0 3" tells it that the left button should do a left click (action 1), the middle button should do nothing, and the right button should do a right click (action 3). If you want to make the middle button also do a left click you could use "1 1 3". If you wanted to switch the right and left actions you could use "3 0 1". See https://wiki.ubuntu.com/X/Config/Input for more info.






    share|improve this answer


























    • Thanks a lot, trying to look this up was getting very frustrating.

      – Tom Hamilton Stubber
      Mar 15 '15 at 13:46






    • 1





      Thanks! For those wondering - the 9/10 are the input id of the mouse and the 1 0 3 are the mappings for the first, second, and third mouse buttons. If you wanted all buttons to do the same thing you could use 1 1 1 or if you want to switch the right and left buttons you could use 3 0 1.

      – Yehosef
      Jul 26 '16 at 8:03













    • @Yehosef: Thanks! I did not explain what is happening when the OP ran the commands. Please create a new detailed answer, ping me and I'll upvote. This is an interesting explaination.

      – Helio
      Jul 26 '16 at 20:13













    • @Helio I don't have a different answer - just more explanation for those interested. Perhaps you want to edit your answer to include this info you can. I was thinking about editing your answer - but I generally don't like it when people add extra details to my answers - so I refrained :)

      – Yehosef
      Jul 27 '16 at 11:15






    • 2





      So how do I determine the first number. I run xinput list | grep 'id=' and look for the things that looks most like my mouse/touchpad? Any definitive way of telling whether it is the right one?

      – Kvothe
      Jul 24 '18 at 21:15
















    19














    Execute those commands:



    xinput set-button-map 9 1 0 3
    xinput set-button-map 10 1 0 3



    Explaination (kindly donated by @Yehosef):



    The first number is the id of the pointer (you'll often only have one, in this case there were two, 9 and 10).



    The next numbers are what you do with the first, second, and third (ie, left, middle, right) mouse buttons. The "1 0 3" tells it that the left button should do a left click (action 1), the middle button should do nothing, and the right button should do a right click (action 3). If you want to make the middle button also do a left click you could use "1 1 3". If you wanted to switch the right and left actions you could use "3 0 1". See https://wiki.ubuntu.com/X/Config/Input for more info.






    share|improve this answer


























    • Thanks a lot, trying to look this up was getting very frustrating.

      – Tom Hamilton Stubber
      Mar 15 '15 at 13:46






    • 1





      Thanks! For those wondering - the 9/10 are the input id of the mouse and the 1 0 3 are the mappings for the first, second, and third mouse buttons. If you wanted all buttons to do the same thing you could use 1 1 1 or if you want to switch the right and left buttons you could use 3 0 1.

      – Yehosef
      Jul 26 '16 at 8:03













    • @Yehosef: Thanks! I did not explain what is happening when the OP ran the commands. Please create a new detailed answer, ping me and I'll upvote. This is an interesting explaination.

      – Helio
      Jul 26 '16 at 20:13













    • @Helio I don't have a different answer - just more explanation for those interested. Perhaps you want to edit your answer to include this info you can. I was thinking about editing your answer - but I generally don't like it when people add extra details to my answers - so I refrained :)

      – Yehosef
      Jul 27 '16 at 11:15






    • 2





      So how do I determine the first number. I run xinput list | grep 'id=' and look for the things that looks most like my mouse/touchpad? Any definitive way of telling whether it is the right one?

      – Kvothe
      Jul 24 '18 at 21:15














    19












    19








    19







    Execute those commands:



    xinput set-button-map 9 1 0 3
    xinput set-button-map 10 1 0 3



    Explaination (kindly donated by @Yehosef):



    The first number is the id of the pointer (you'll often only have one, in this case there were two, 9 and 10).



    The next numbers are what you do with the first, second, and third (ie, left, middle, right) mouse buttons. The "1 0 3" tells it that the left button should do a left click (action 1), the middle button should do nothing, and the right button should do a right click (action 3). If you want to make the middle button also do a left click you could use "1 1 3". If you wanted to switch the right and left actions you could use "3 0 1". See https://wiki.ubuntu.com/X/Config/Input for more info.






    share|improve this answer















    Execute those commands:



    xinput set-button-map 9 1 0 3
    xinput set-button-map 10 1 0 3



    Explaination (kindly donated by @Yehosef):



    The first number is the id of the pointer (you'll often only have one, in this case there were two, 9 and 10).



    The next numbers are what you do with the first, second, and third (ie, left, middle, right) mouse buttons. The "1 0 3" tells it that the left button should do a left click (action 1), the middle button should do nothing, and the right button should do a right click (action 3). If you want to make the middle button also do a left click you could use "1 1 3". If you wanted to switch the right and left actions you could use "3 0 1". See https://wiki.ubuntu.com/X/Config/Input for more info.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 13 '17 at 12:24









    Community

    1




    1










    answered Mar 15 '15 at 13:44









    HelioHelio

    5,41432750




    5,41432750













    • Thanks a lot, trying to look this up was getting very frustrating.

      – Tom Hamilton Stubber
      Mar 15 '15 at 13:46






    • 1





      Thanks! For those wondering - the 9/10 are the input id of the mouse and the 1 0 3 are the mappings for the first, second, and third mouse buttons. If you wanted all buttons to do the same thing you could use 1 1 1 or if you want to switch the right and left buttons you could use 3 0 1.

      – Yehosef
      Jul 26 '16 at 8:03













    • @Yehosef: Thanks! I did not explain what is happening when the OP ran the commands. Please create a new detailed answer, ping me and I'll upvote. This is an interesting explaination.

      – Helio
      Jul 26 '16 at 20:13













    • @Helio I don't have a different answer - just more explanation for those interested. Perhaps you want to edit your answer to include this info you can. I was thinking about editing your answer - but I generally don't like it when people add extra details to my answers - so I refrained :)

      – Yehosef
      Jul 27 '16 at 11:15






    • 2





      So how do I determine the first number. I run xinput list | grep 'id=' and look for the things that looks most like my mouse/touchpad? Any definitive way of telling whether it is the right one?

      – Kvothe
      Jul 24 '18 at 21:15



















    • Thanks a lot, trying to look this up was getting very frustrating.

      – Tom Hamilton Stubber
      Mar 15 '15 at 13:46






    • 1





      Thanks! For those wondering - the 9/10 are the input id of the mouse and the 1 0 3 are the mappings for the first, second, and third mouse buttons. If you wanted all buttons to do the same thing you could use 1 1 1 or if you want to switch the right and left buttons you could use 3 0 1.

      – Yehosef
      Jul 26 '16 at 8:03













    • @Yehosef: Thanks! I did not explain what is happening when the OP ran the commands. Please create a new detailed answer, ping me and I'll upvote. This is an interesting explaination.

      – Helio
      Jul 26 '16 at 20:13













    • @Helio I don't have a different answer - just more explanation for those interested. Perhaps you want to edit your answer to include this info you can. I was thinking about editing your answer - but I generally don't like it when people add extra details to my answers - so I refrained :)

      – Yehosef
      Jul 27 '16 at 11:15






    • 2





      So how do I determine the first number. I run xinput list | grep 'id=' and look for the things that looks most like my mouse/touchpad? Any definitive way of telling whether it is the right one?

      – Kvothe
      Jul 24 '18 at 21:15

















    Thanks a lot, trying to look this up was getting very frustrating.

    – Tom Hamilton Stubber
    Mar 15 '15 at 13:46





    Thanks a lot, trying to look this up was getting very frustrating.

    – Tom Hamilton Stubber
    Mar 15 '15 at 13:46




    1




    1





    Thanks! For those wondering - the 9/10 are the input id of the mouse and the 1 0 3 are the mappings for the first, second, and third mouse buttons. If you wanted all buttons to do the same thing you could use 1 1 1 or if you want to switch the right and left buttons you could use 3 0 1.

    – Yehosef
    Jul 26 '16 at 8:03







    Thanks! For those wondering - the 9/10 are the input id of the mouse and the 1 0 3 are the mappings for the first, second, and third mouse buttons. If you wanted all buttons to do the same thing you could use 1 1 1 or if you want to switch the right and left buttons you could use 3 0 1.

    – Yehosef
    Jul 26 '16 at 8:03















    @Yehosef: Thanks! I did not explain what is happening when the OP ran the commands. Please create a new detailed answer, ping me and I'll upvote. This is an interesting explaination.

    – Helio
    Jul 26 '16 at 20:13







    @Yehosef: Thanks! I did not explain what is happening when the OP ran the commands. Please create a new detailed answer, ping me and I'll upvote. This is an interesting explaination.

    – Helio
    Jul 26 '16 at 20:13















    @Helio I don't have a different answer - just more explanation for those interested. Perhaps you want to edit your answer to include this info you can. I was thinking about editing your answer - but I generally don't like it when people add extra details to my answers - so I refrained :)

    – Yehosef
    Jul 27 '16 at 11:15





    @Helio I don't have a different answer - just more explanation for those interested. Perhaps you want to edit your answer to include this info you can. I was thinking about editing your answer - but I generally don't like it when people add extra details to my answers - so I refrained :)

    – Yehosef
    Jul 27 '16 at 11:15




    2




    2





    So how do I determine the first number. I run xinput list | grep 'id=' and look for the things that looks most like my mouse/touchpad? Any definitive way of telling whether it is the right one?

    – Kvothe
    Jul 24 '18 at 21:15





    So how do I determine the first number. I run xinput list | grep 'id=' and look for the things that looks most like my mouse/touchpad? Any definitive way of telling whether it is the right one?

    – Kvothe
    Jul 24 '18 at 21:15













    1














    Following instructions are based on info at Ubuntu Wiki
    (Scroll down to title "Example: Disabling middle-mouse button paste on a scrollwheel mouse").



    First, determine id of the pointer by listing input devices:



    xinput list | grep 'id='


    And look for the line that contains name of your pointer, there also should be id of the device, right after "id=". For example, id of this device is 10:



    Lenovo ThinkPad Compact USB Keyboard with TrackPoint    id=10   [slave  pointer  (2)]


    Next, get current button map of that device (I'll be using id of my device, which is 10):



    xinput get-button-map 10


    Output:



    1 2 3 4 5 6 7 8 9


    This is mapping of pointer buttons to actions, where number represents action code, and position - button.



    We're interested in second map - number 2 corresponds to action "Middle Button Click" and the position of it - to actual middle button.



    To disable middle button triggering any action, I'd use command xinput set-button-map with id of the device and updated map (new action code is 0 - no action). No need to put whole map - map till interested button suffice (the rest just won't be updated):



     xinput set-button-map 10 1 0


    That's it.






    share|improve this answer




























      1














      Following instructions are based on info at Ubuntu Wiki
      (Scroll down to title "Example: Disabling middle-mouse button paste on a scrollwheel mouse").



      First, determine id of the pointer by listing input devices:



      xinput list | grep 'id='


      And look for the line that contains name of your pointer, there also should be id of the device, right after "id=". For example, id of this device is 10:



      Lenovo ThinkPad Compact USB Keyboard with TrackPoint    id=10   [slave  pointer  (2)]


      Next, get current button map of that device (I'll be using id of my device, which is 10):



      xinput get-button-map 10


      Output:



      1 2 3 4 5 6 7 8 9


      This is mapping of pointer buttons to actions, where number represents action code, and position - button.



      We're interested in second map - number 2 corresponds to action "Middle Button Click" and the position of it - to actual middle button.



      To disable middle button triggering any action, I'd use command xinput set-button-map with id of the device and updated map (new action code is 0 - no action). No need to put whole map - map till interested button suffice (the rest just won't be updated):



       xinput set-button-map 10 1 0


      That's it.






      share|improve this answer


























        1












        1








        1







        Following instructions are based on info at Ubuntu Wiki
        (Scroll down to title "Example: Disabling middle-mouse button paste on a scrollwheel mouse").



        First, determine id of the pointer by listing input devices:



        xinput list | grep 'id='


        And look for the line that contains name of your pointer, there also should be id of the device, right after "id=". For example, id of this device is 10:



        Lenovo ThinkPad Compact USB Keyboard with TrackPoint    id=10   [slave  pointer  (2)]


        Next, get current button map of that device (I'll be using id of my device, which is 10):



        xinput get-button-map 10


        Output:



        1 2 3 4 5 6 7 8 9


        This is mapping of pointer buttons to actions, where number represents action code, and position - button.



        We're interested in second map - number 2 corresponds to action "Middle Button Click" and the position of it - to actual middle button.



        To disable middle button triggering any action, I'd use command xinput set-button-map with id of the device and updated map (new action code is 0 - no action). No need to put whole map - map till interested button suffice (the rest just won't be updated):



         xinput set-button-map 10 1 0


        That's it.






        share|improve this answer













        Following instructions are based on info at Ubuntu Wiki
        (Scroll down to title "Example: Disabling middle-mouse button paste on a scrollwheel mouse").



        First, determine id of the pointer by listing input devices:



        xinput list | grep 'id='


        And look for the line that contains name of your pointer, there also should be id of the device, right after "id=". For example, id of this device is 10:



        Lenovo ThinkPad Compact USB Keyboard with TrackPoint    id=10   [slave  pointer  (2)]


        Next, get current button map of that device (I'll be using id of my device, which is 10):



        xinput get-button-map 10


        Output:



        1 2 3 4 5 6 7 8 9


        This is mapping of pointer buttons to actions, where number represents action code, and position - button.



        We're interested in second map - number 2 corresponds to action "Middle Button Click" and the position of it - to actual middle button.



        To disable middle button triggering any action, I'd use command xinput set-button-map with id of the device and updated map (new action code is 0 - no action). No need to put whole map - map till interested button suffice (the rest just won't be updated):



         xinput set-button-map 10 1 0


        That's it.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 23 at 4:47









        bruddhabruddha

        1386




        1386






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • 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%2faskubuntu.com%2fquestions%2f597064%2fdisabling-middle-mouse-button%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

            Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

            ComboBox Display Member on multiple fields

            Is it possible to collect Nectar points via Trainline?