Swapping mouse button in wayland + KDE

Many thanks for the link.

The evtest shows

hpprol2:~ # evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Power Button
/dev/input/event1:      CHICONY HP Basic USB Keyboard
/dev/input/event2:      Kingsis Peripherals Evoluent VerticalMouse 4
/dev/input/event3:      PC Speaker
Select the device event number [0-3]: 2
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x1a7c product 0x191 version 0x111
Input device name: "Kingsis Peripherals Evoluent VerticalMouse 4"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 274 (BTN_MIDDLE)
    Event code 275 (BTN_SIDE)
    Event code 276 (BTN_EXTRA)
    Event code 277 (BTN_FORWARD)
  Event type 2 (EV_REL)
    Event code 0 (REL_X)
    Event code 1 (REL_Y)
    Event code 6 (REL_HWHEEL)
    Event code 8 (REL_WHEEL)
    Event code 11 (REL_WHEEL_HI_RES)
    Event code 12 (REL_HWHEEL_HI_RES)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
Event: time 1709215636.116517, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90003
Event: time 1709215636.116517, type 1 (EV_KEY), code 274 (BTN_MIDDLE), value 1
Event: time 1709215636.116517, -------------- SYN_REPORT ------------
Event: time 1709215636.293512, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90003
Event: time 1709215636.293512, type 1 (EV_KEY), code 274 (BTN_MIDDLE), value 0
Event: time 1709215636.293512, -------------- SYN_REPORT ------------
Event: time 1709215637.468573, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1709215637.468573, type 1 (EV_KEY), code 273 (BTN_RIGHT), value 1
Event: time 1709215637.468573, -------------- SYN_REPORT ------------
Event: time 1709215637.601500, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002
Event: time 1709215637.601500, type 1 (EV_KEY), code 273 (BTN_RIGHT), value 0

I created the directory /etc/udev/hwdb.d and therein the file 99-test.hwdb with this content

evdev:input:b0003v1A7Cp0191*
 KEYBOARD_KEY_90002=btn_middle
 KEYBOARD_KEY_90003=btn_right

therafter

# systemd-hwdb update 
# udevadm trigger

and the button are swapped :smiley:

I removed the evmouse.sh script

Mant thanks for your help
Philippe

1 Like