Middle mouse button emulated even though disabled in xinput/libinput











up vote
0
down vote

favorite












It should be disabled, and yet I get middle mouse button clicks. When I run xinput list I get this:



⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ PixArt Microsoft USB Optical Mouse id=9 [slave pointer (2)]
⎜ ↳ SQT USB Gaming Keyboard id=11 [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)]


... and a few more non-pointing devices. Examining each of these in turn, I see that only 9 (the mouse) has middle click emulation set... to zero.



Device 'PixArt Microsoft USB Optical Mouse':
Device Enabled (152): 1
Coordinate Transformation Matrix (154): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (288): 0
libinput Natural Scrolling Enabled Default (289): 0
libinput Scroll Methods Available (290): 0, 0, 1
libinput Scroll Method Enabled (291): 0, 0, 0
libinput Scroll Method Enabled Default (292): 0, 0, 0
libinput Button Scrolling Button (293): 2
libinput Button Scrolling Button Default (294): 2
libinput Middle Emulation Enabled (295): 0
libinput Middle Emulation Enabled Default (296): 0
libinput Accel Speed (297): 0.000000
libinput Accel Speed Default (298): 0.000000
libinput Accel Profiles Available (299): 1, 1
libinput Accel Profile Enabled (300): 1, 0
libinput Accel Profile Enabled Default (301): 1, 0
libinput Left Handed Enabled (302): 0
libinput Left Handed Enabled Default (303): 0
libinput Send Events Modes Available (273): 1, 0
libinput Send Events Mode Enabled (274): 0, 0
libinput Send Events Mode Enabled Default (275): 0, 0
Device Node (276): "/dev/input/event3"
Device Product ID (277): 1118, 203
libinput Drag Lock Buttons (304): <no items>
libinput Horizontal Scroll Enabled (305): 1


And yet I get middle clicks in games. To prove I'm not going crazy, I wrote a tiny SDL2 program myself to check:



#include <SDL.h>

int main(int argc, char ** argv)
{
int quit = 0;
SDL_Event event;
SDL_Init(SDL_INIT_VIDEO);
SDL_Window *window = SDL_CreateWindow("Middle click detector",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0);

while (!quit)
{
SDL_WaitEvent(&event);
switch (event.type)
{
case SDL_QUIT:
quit = 1;
break;
case SDL_MOUSEBUTTONDOWN:
if (event.button.button == SDL_BUTTON_MIDDLE)
printf("Middle clicked!n");
else if (event.button.button == SDL_BUTTON_LEFT)
printf("Left clicked!n");
else if (event.button.button == SDL_BUTTON_RIGHT)
printf("Right clicked!n");
else
printf("What clicked?n");
}
}
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}


(compiled with gcc sdltest.c -Wall `sdl2-config --cflags --libs`)



Sure enough, if I hold left and click right, I get:



Left clicked!
Right clicked!
Middle clicked!


People who know anything about the input pipeline on Linux, can you please give me a clue where to look next? I'm at a loss. I'll also be grateful for anyone who can run the test program and confirm or deny that they have the same issue.










share|improve this question


























    up vote
    0
    down vote

    favorite












    It should be disabled, and yet I get middle mouse button clicks. When I run xinput list I get this:



    ⎡ Virtual core pointer                      id=2    [master pointer  (3)]
    ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
    ⎜ ↳ PixArt Microsoft USB Optical Mouse id=9 [slave pointer (2)]
    ⎜ ↳ SQT USB Gaming Keyboard id=11 [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)]


    ... and a few more non-pointing devices. Examining each of these in turn, I see that only 9 (the mouse) has middle click emulation set... to zero.



    Device 'PixArt Microsoft USB Optical Mouse':
    Device Enabled (152): 1
    Coordinate Transformation Matrix (154): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    libinput Natural Scrolling Enabled (288): 0
    libinput Natural Scrolling Enabled Default (289): 0
    libinput Scroll Methods Available (290): 0, 0, 1
    libinput Scroll Method Enabled (291): 0, 0, 0
    libinput Scroll Method Enabled Default (292): 0, 0, 0
    libinput Button Scrolling Button (293): 2
    libinput Button Scrolling Button Default (294): 2
    libinput Middle Emulation Enabled (295): 0
    libinput Middle Emulation Enabled Default (296): 0
    libinput Accel Speed (297): 0.000000
    libinput Accel Speed Default (298): 0.000000
    libinput Accel Profiles Available (299): 1, 1
    libinput Accel Profile Enabled (300): 1, 0
    libinput Accel Profile Enabled Default (301): 1, 0
    libinput Left Handed Enabled (302): 0
    libinput Left Handed Enabled Default (303): 0
    libinput Send Events Modes Available (273): 1, 0
    libinput Send Events Mode Enabled (274): 0, 0
    libinput Send Events Mode Enabled Default (275): 0, 0
    Device Node (276): "/dev/input/event3"
    Device Product ID (277): 1118, 203
    libinput Drag Lock Buttons (304): <no items>
    libinput Horizontal Scroll Enabled (305): 1


    And yet I get middle clicks in games. To prove I'm not going crazy, I wrote a tiny SDL2 program myself to check:



    #include <SDL.h>

    int main(int argc, char ** argv)
    {
    int quit = 0;
    SDL_Event event;
    SDL_Init(SDL_INIT_VIDEO);
    SDL_Window *window = SDL_CreateWindow("Middle click detector",
    SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0);

    while (!quit)
    {
    SDL_WaitEvent(&event);
    switch (event.type)
    {
    case SDL_QUIT:
    quit = 1;
    break;
    case SDL_MOUSEBUTTONDOWN:
    if (event.button.button == SDL_BUTTON_MIDDLE)
    printf("Middle clicked!n");
    else if (event.button.button == SDL_BUTTON_LEFT)
    printf("Left clicked!n");
    else if (event.button.button == SDL_BUTTON_RIGHT)
    printf("Right clicked!n");
    else
    printf("What clicked?n");
    }
    }
    SDL_DestroyWindow(window);
    SDL_Quit();
    return 0;
    }


    (compiled with gcc sdltest.c -Wall `sdl2-config --cflags --libs`)



    Sure enough, if I hold left and click right, I get:



    Left clicked!
    Right clicked!
    Middle clicked!


    People who know anything about the input pipeline on Linux, can you please give me a clue where to look next? I'm at a loss. I'll also be grateful for anyone who can run the test program and confirm or deny that they have the same issue.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      It should be disabled, and yet I get middle mouse button clicks. When I run xinput list I get this:



      ⎡ Virtual core pointer                      id=2    [master pointer  (3)]
      ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
      ⎜ ↳ PixArt Microsoft USB Optical Mouse id=9 [slave pointer (2)]
      ⎜ ↳ SQT USB Gaming Keyboard id=11 [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)]


      ... and a few more non-pointing devices. Examining each of these in turn, I see that only 9 (the mouse) has middle click emulation set... to zero.



      Device 'PixArt Microsoft USB Optical Mouse':
      Device Enabled (152): 1
      Coordinate Transformation Matrix (154): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
      libinput Natural Scrolling Enabled (288): 0
      libinput Natural Scrolling Enabled Default (289): 0
      libinput Scroll Methods Available (290): 0, 0, 1
      libinput Scroll Method Enabled (291): 0, 0, 0
      libinput Scroll Method Enabled Default (292): 0, 0, 0
      libinput Button Scrolling Button (293): 2
      libinput Button Scrolling Button Default (294): 2
      libinput Middle Emulation Enabled (295): 0
      libinput Middle Emulation Enabled Default (296): 0
      libinput Accel Speed (297): 0.000000
      libinput Accel Speed Default (298): 0.000000
      libinput Accel Profiles Available (299): 1, 1
      libinput Accel Profile Enabled (300): 1, 0
      libinput Accel Profile Enabled Default (301): 1, 0
      libinput Left Handed Enabled (302): 0
      libinput Left Handed Enabled Default (303): 0
      libinput Send Events Modes Available (273): 1, 0
      libinput Send Events Mode Enabled (274): 0, 0
      libinput Send Events Mode Enabled Default (275): 0, 0
      Device Node (276): "/dev/input/event3"
      Device Product ID (277): 1118, 203
      libinput Drag Lock Buttons (304): <no items>
      libinput Horizontal Scroll Enabled (305): 1


      And yet I get middle clicks in games. To prove I'm not going crazy, I wrote a tiny SDL2 program myself to check:



      #include <SDL.h>

      int main(int argc, char ** argv)
      {
      int quit = 0;
      SDL_Event event;
      SDL_Init(SDL_INIT_VIDEO);
      SDL_Window *window = SDL_CreateWindow("Middle click detector",
      SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0);

      while (!quit)
      {
      SDL_WaitEvent(&event);
      switch (event.type)
      {
      case SDL_QUIT:
      quit = 1;
      break;
      case SDL_MOUSEBUTTONDOWN:
      if (event.button.button == SDL_BUTTON_MIDDLE)
      printf("Middle clicked!n");
      else if (event.button.button == SDL_BUTTON_LEFT)
      printf("Left clicked!n");
      else if (event.button.button == SDL_BUTTON_RIGHT)
      printf("Right clicked!n");
      else
      printf("What clicked?n");
      }
      }
      SDL_DestroyWindow(window);
      SDL_Quit();
      return 0;
      }


      (compiled with gcc sdltest.c -Wall `sdl2-config --cflags --libs`)



      Sure enough, if I hold left and click right, I get:



      Left clicked!
      Right clicked!
      Middle clicked!


      People who know anything about the input pipeline on Linux, can you please give me a clue where to look next? I'm at a loss. I'll also be grateful for anyone who can run the test program and confirm or deny that they have the same issue.










      share|improve this question













      It should be disabled, and yet I get middle mouse button clicks. When I run xinput list I get this:



      ⎡ Virtual core pointer                      id=2    [master pointer  (3)]
      ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
      ⎜ ↳ PixArt Microsoft USB Optical Mouse id=9 [slave pointer (2)]
      ⎜ ↳ SQT USB Gaming Keyboard id=11 [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)]


      ... and a few more non-pointing devices. Examining each of these in turn, I see that only 9 (the mouse) has middle click emulation set... to zero.



      Device 'PixArt Microsoft USB Optical Mouse':
      Device Enabled (152): 1
      Coordinate Transformation Matrix (154): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
      libinput Natural Scrolling Enabled (288): 0
      libinput Natural Scrolling Enabled Default (289): 0
      libinput Scroll Methods Available (290): 0, 0, 1
      libinput Scroll Method Enabled (291): 0, 0, 0
      libinput Scroll Method Enabled Default (292): 0, 0, 0
      libinput Button Scrolling Button (293): 2
      libinput Button Scrolling Button Default (294): 2
      libinput Middle Emulation Enabled (295): 0
      libinput Middle Emulation Enabled Default (296): 0
      libinput Accel Speed (297): 0.000000
      libinput Accel Speed Default (298): 0.000000
      libinput Accel Profiles Available (299): 1, 1
      libinput Accel Profile Enabled (300): 1, 0
      libinput Accel Profile Enabled Default (301): 1, 0
      libinput Left Handed Enabled (302): 0
      libinput Left Handed Enabled Default (303): 0
      libinput Send Events Modes Available (273): 1, 0
      libinput Send Events Mode Enabled (274): 0, 0
      libinput Send Events Mode Enabled Default (275): 0, 0
      Device Node (276): "/dev/input/event3"
      Device Product ID (277): 1118, 203
      libinput Drag Lock Buttons (304): <no items>
      libinput Horizontal Scroll Enabled (305): 1


      And yet I get middle clicks in games. To prove I'm not going crazy, I wrote a tiny SDL2 program myself to check:



      #include <SDL.h>

      int main(int argc, char ** argv)
      {
      int quit = 0;
      SDL_Event event;
      SDL_Init(SDL_INIT_VIDEO);
      SDL_Window *window = SDL_CreateWindow("Middle click detector",
      SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0);

      while (!quit)
      {
      SDL_WaitEvent(&event);
      switch (event.type)
      {
      case SDL_QUIT:
      quit = 1;
      break;
      case SDL_MOUSEBUTTONDOWN:
      if (event.button.button == SDL_BUTTON_MIDDLE)
      printf("Middle clicked!n");
      else if (event.button.button == SDL_BUTTON_LEFT)
      printf("Left clicked!n");
      else if (event.button.button == SDL_BUTTON_RIGHT)
      printf("Right clicked!n");
      else
      printf("What clicked?n");
      }
      }
      SDL_DestroyWindow(window);
      SDL_Quit();
      return 0;
      }


      (compiled with gcc sdltest.c -Wall `sdl2-config --cflags --libs`)



      Sure enough, if I hold left and click right, I get:



      Left clicked!
      Right clicked!
      Middle clicked!


      People who know anything about the input pipeline on Linux, can you please give me a clue where to look next? I'm at a loss. I'll also be grateful for anyone who can run the test program and confirm or deny that they have the same issue.







      mouse xinput libinput






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 at 19:47









      Harald Korneliussen

      1012




      1012






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          It just occurred to me to test out with another mouse. No middle click.



          This seems to be a physical (mis)feature of the PixArt Microsoft USB Optical Mouse.






          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: 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%2f1094915%2fmiddle-mouse-button-emulated-even-though-disabled-in-xinput-libinput%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            It just occurred to me to test out with another mouse. No middle click.



            This seems to be a physical (mis)feature of the PixArt Microsoft USB Optical Mouse.






            share|improve this answer

























              up vote
              0
              down vote













              It just occurred to me to test out with another mouse. No middle click.



              This seems to be a physical (mis)feature of the PixArt Microsoft USB Optical Mouse.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                It just occurred to me to test out with another mouse. No middle click.



                This seems to be a physical (mis)feature of the PixArt Microsoft USB Optical Mouse.






                share|improve this answer












                It just occurred to me to test out with another mouse. No middle click.



                This seems to be a physical (mis)feature of the PixArt Microsoft USB Optical Mouse.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 at 19:58









                Harald Korneliussen

                1012




                1012






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1094915%2fmiddle-mouse-button-emulated-even-though-disabled-in-xinput-libinput%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

                    Ellipse (mathématiques)

                    Quarter-circle Tiles

                    Mont Emei