Remapping joystick buttons

Hello all.
I need to remap the order of the buttons of a Logitech G27 racing wheel, to be correctly recognized in a racing sim via Wine.
Basically I need the buttons 12, 13…17 to be read as buttons 1, 2…6.
I guess I should remap it in xorg.conf and that the wheel uses evdev driver, so I modified that file following xorg and evdev available online helps… but nothing happens with the order of the buttons.

This is my xorg.conf. Please, let me know if you need some additional information.

Thanks a lot in advance! Marcos. (thanks for the help with the code format :wink: )

    Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
	InputDevice	   "Wheel0"  
EndSection
	
Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "/usr/share/fonts/misc"
	FontPath     "/usr/share/fonts/TTF"
	FontPath     "/usr/share/fonts/OTF"
	FontPath     "/usr/share/fonts/Type1"
	FontPath     "/usr/share/fonts/100dpi"
	FontPath     "/usr/share/fonts/75dpi"
EndSection

Section "Module"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "Accel"              	# [<bool>]
        #Option     "AccelMethod"        	# <str>
        #Option     "Backlight"          	# <str>
        #Option     "CustomEDID"         	# <str>
        #Option     "DRI"                	# <str>
        #Option     "Present"            	# [<bool>]
        #Option     "ColorKey"           	# <i>
        #Option     "VideoKey"           	# <i>
        #Option     "Tiling"             	# [<bool>]
        #Option     "LinearFramebuffer"  	# [<bool>]
        #Option     "HWRotation"         	# [<bool>]
        #Option     "VSync"              	# [<bool>]
        #Option     "PageFlip"           	# [<bool>]
        #Option     "SwapbuffersWait"    	# [<bool>]
        #Option     "TripleBuffer"       	# [<bool>]
        #Option     "XvPreferOverlay"    	# [<bool>]
        #Option     "HotPlug"            	# [<bool>]
        #Option     "ReprobeOutputs"     	# [<bool>]
        #Option     "XvMC"               	# [<bool>]
        #Option     "ZaphodHeads"        	# <str>
        #Option     "VirtualHeads"       	# <i>
        #Option     "TearFree"           	# [<bool>]
        #Option     "PerCrtcPixmaps"     	# [<bool>]
        #Option     "FallbackDebug"      	# [<bool>]
        #Option     "DebugFlushBatches"  	# [<bool>]
        #Option     "DebugFlushCaches"   	# [<bool>]
        #Option     "DebugWait"          	# [<bool>]
        #Option     "BufferCache"        	# [<bool>]
	Identifier  "Card0"
	Driver      "intel"
	BusID       "PCI:0:2:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

Section "InputDevice"
  Identifier "Wheel0"
  Driver "evdev"
  Option "Device" "/dev/input/event16"
  Option "ButtonMapping" "12 13 14 15 16 17 18 0 1 2 3 4 5 6 7 8 9 10 11 19 20 21 22"
EndSection

I suggest trying Oversteer (available in the AUR).

I’ve done it for you. Use the Preformatted text </> button or add three backticks ``` above and below the code block.

1 Like

Thanks for your answer Yochanan.
I tried Oversteer and that program tests buttons but doesn’t allow to remap them. I also wrote to his author asking for some help and he recommended me to modify the xorg.conf

Updates/Attempts.

  1. Deactivated in Wine the event and activated the js-based joystick and, afer remapping the buttons with jstest-gtk, I got the shifter working… but the FF is awful. Apparently the kernel support for the Logitech wheels works well only with evdev api driver (and not joystick api)

  2. Installed pyLinuxWheel, and it works great, but only fix the FF of evdev api and, in general, is just like Oversteer in that sense.

So, in the current state I have either FF or Shifter, but not both at the same time :stuck_out_tongue:

I still would appreciate any advise

Marcos.