Skip to content

Instantly share code, notes, and snippets.

@diffficult
Created March 30, 2024 22:13
Show Gist options
  • Save diffficult/15b5da1c610c8a090b2a58bd93e2c843 to your computer and use it in GitHub Desktop.
Save diffficult/15b5da1c610c8a090b2a58bd93e2c843 to your computer and use it in GitHub Desktop.
ELECOM Huge Config XORG

ELECOM Trackball Mouse HUGE Trackball

Needed to remap keys on my ELECOM Huge Trackball, so I wrote a .conf file to be loaded at boot by X.

The ELECOM Huge has 12 keys you can assign. I will be remapping Fn1 and Fn2 which are near my index finger to be used as regular Left Click and Middle Click

Code Default Key Remap Key
1 Left Left
2 Middle Middle
3 Right Right
4 Scroll Up Scroll Up
5 Scroll Down Scroll Down
6 Tilt Left Tilt Left
7 Tilt Right Tilt Right
8 Back Back
9 Forward Forward
10 Fn1 Left
11 Fn2 Middle
12 Fn3 Fn3

I'm using libinput and you can get any related info about the keys you can remap and the name of the device you need to refer to in the config file using xinput. You can list which keys you can remap and also set the new remap on the fly.

$ xinput list

...
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ ....
⎜   ↳ ELECOM TrackBall Mouse HUGE TrackBall     id=8    [slave  pointer  (2)]
⎜   ↳ ....
...

$ xinput get-button-map 8
                          
1 2 3 4 5 6 7 8 9 10 11 12 

$ xinput set-button-map 8 1 2 3 4 5 6 7 8 9 1 2 12

To make the change permanent, we need to create a file named 20-elecom-huge.conf in /etc/X11/xorg.conf.d that will load when startx runs

20-elecom-huge.conf

Section "InputClass"
        Identifier "ELECOM TrackBall Mouse"
        MatchProduct "HUGE TrackBall"
#        MatchVendor "ELECOM TrackBall Mouse HUGE TrackBall "
#        MatchIsPointer "on"
        Driver "libinput"
        Option "AccelSpeed" "0.2"
        Option "Buttons" "12"
        Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 1 2 12" # L Middle R ScrollU ScrollD TiltL TiltR Back Forw Fn1 Fn2 Fn3 (Fn1 is L, Fn2 is Mid)
        Option "EmulateWheel" "true"
        Option "EmulateWheelButton" "12"
        Option "EmulateWheelTimeout" "0"
        Option "ScrollMethod" "Button"
        Option "ScrollButton" "12"
EndSection

Source:

https://www.reddit.com/r/Trackballs/comments/qo8x3c/elecom_huge_libinput_help/

https://unix.stackexchange.com/questions/680102/xinput-libinput-button-remapping-with-trackball-scrolling

https://bbs.archlinux.org/viewtopic.php?id=254470

http://www.mario-konrad.ch/blog/linux/libinput-elecom-huge.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment