Results 1 to 8 of 8

Thread: map mouse buttons.

  1. #1

    Default map mouse buttons.

    I have LEAP 42.3 installed with XFCE, I'd like to map the roller button to an browser back command when pressed.
    The XFCE mouse applet doesn't recognize the button as anything but a two button mouse, although the scroll wheel works.
    Where to start?

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,695
    Blog Entries
    1

    Default Re: map mouse buttons.

    How does libinput enumerate the device?
    Code:
    xinput  list
    The following will capture events associated with input events such as button pressing/releasing
    Code:
    sudo libinput-debug-events
    This ArchWiki page discusses button-remapping with libinput...
    https://wiki.archlinux.org/index.php...ton_re-mapping

  3. #3

    Default Re: map mouse buttons.

    EVENT3 POINTER_BUTTON +22.19s BTN_MIDDLE (274) pressed, seat count 1
    sudo libinput-debug-events event3 POINTER_BUTTON +22.42s BTN_MIDDLE (274) RELEASED, SEAT COUNT: 0

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,695
    Blog Entries
    1

    Default Re: map mouse buttons.

    Quote Originally Posted by red_fir_smoke View Post
    EVENT3 POINTER_BUTTON +22.19s BTN_MIDDLE (274) pressed, seat count 1
    sudo libinput-debug-events event3 POINTER_BUTTON +22.42s BTN_MIDDLE (274) RELEASED, SEAT COUNT: 0
    Somehow you mangled that output...always best to copy paste the command and output, and enclose within [CODE][/COD.]tags (refer to the '#' button in the forum editor).

  5. #5
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,695
    Blog Entries
    1

    Default Re: map mouse buttons.

    Install and use xbindkeys to bind a mouse button to the required command....

    https://blog.hanschen.org/2009/10/13...ith-xbindkeys/

  6. #6
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,695
    Blog Entries
    1

    Default Re: map mouse buttons.

    Now that I've had a chance to investigate this further, the following should help with identifying the pertinent mouse button...
    Code:
    xev | grep -A 2 Button
    Along, with xbindkeys, the xte utility (from the xautomation package) can be used to emulate key presses, and used in the ~/.xbindkeysrc configuration file to be executed on a mouse button push. This is outlined in the blog I linked to already and should do what you're trying to achieve...
    This trick can also be used to map the back/forward buttons on the mouse. Here we can’t use D-Bus, since we want to “talk” to the active window and not a specific application. Fortunately for us, most applications use the key shortcuts Alt+Left and Alt+Right for Back and Forward, respectively. In other words, we can do something like this:
    # Back
    "xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"
    b:6

    # Forward
    "xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'"
    b:7
    This’ll work in Dolphin, Konqueror, Firefox, and basically any application that use the same shortcut for Back/Forward.
    *You'll need to change the button values to suit your input device of course.

    Hope that helps.

  7. #7

    Default Re: map mouse buttons.

    Thank you!
    That worked perfectly!

  8. #8
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,695
    Blog Entries
    1

    Default Re: map mouse buttons.

    Quote Originally Posted by red_fir_smoke View Post
    Thank you!
    That worked perfectly!
    Good to know that worked for you!

Posting Permissions

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