You are not logged in.

#1 2024-03-30 05:42:59

lo7777799
Member
Registered: 2023-07-25
Posts: 37

mouse buttons config under Xorg and evdev

hello,

i post this here, because Xorg has to do with my  problem.


i have a question.

here ...

https://wiki.archlinux.org/title/Mouse_buttons

stays, how i can config my mouse buttons. i want to make my mouse button 4 to left shift and my mouse button 5 to left ctrl. i want to do that with evdev and without xorg. is that possible?

--- which chapters of that wiki site should i do to config my mouse? ---

thanks for anyone who try to help me.

Last edited by lo7777799 (2024-03-30 06:49:45)

Offline

#2 2024-03-30 05:55:25

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

should i also do the chapters 1 to 3,  if i want to config my mouse with evdev and not with xorg?

Last edited by lo7777799 (2024-03-30 06:46:56)

Offline

#3 2024-03-30 07:57:30

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: mouse buttons config under Xorg and evdev

i want to make my mouse button 4 to left shift and my mouse button 5 to left ctrl

4 & 5 are the wheel "buttons" - how do you intend to use them as modifiers? You cannot "hold" the wheel.

Offline

#4 2024-03-30 08:26:48

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

oh sry, i dont mean the wheel buttons.

i mean the 2 side buttons , that i click with my thumb.

i want use my 2 thumb buttons as left shift and left ctrl.

i have a Logitech G203 Prodigy Gaming Mouse

what should i do to use evdev to configure mouse buttons to left shift and left ctrl ?

Last edited by lo7777799 (2024-03-30 08:34:46)

Offline

#5 2024-03-30 08:50:43

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: mouse buttons config under Xorg and evdev

For plain evdev, you'd use the udev hwdb, see eg.
https://unix.stackexchange.com/question … -udev-hwdb
https://bbs.archlinux.org/viewtopic.php?id=260824

Or you use evrouter.
But if your only concern is X11, xbindkeys will get the job done just as much, but you'd likely have to bind press and release independently for a modifier.

Offline

#6 2024-03-30 12:45:59

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

i want to do it with evdev.

i mean, it goes so. correct me, if i say something wrong.


first, i  write in xorg.conf

Section "InputDevice" 
	Identifier 	"Evdev Mouse" 
	Driver 		"evdev" 
	Option 		"Name" "Logitech G203 Prodigy Gaming Mouse" 
	Option 		"evBits" "+1-2" 
	Option 		"keyBits" "~272-287" 
	Option    	"relBits" "~0-2 ~6 ~8" 
	Option 		"Pass" 	"3" 
	Option 		"CorePointer" 
EndSection  

then i write in xorg,conf in server layout 1 line ...

Section "ServerLayout" 
	Identifier 	"Default Layout" 
	Screen 0 	"Monitor0" 0 0 
	InputDevice 	"Keyboard0" "CoreKeyboard" 
	InputDevice 	"Evdev Mouse" "CorePointer" 
EndSection  

the  mouse line is new.

is that right so, if i want use evdev for mouse keys?

and what should i  do for the thumb mouse keys ?

ps:

grep -E "Name|Handlers" /proc/bus/input/devices | grep -E -B1 'Handlers.*mouse' 

N: Name="Logitech G203 Prodigy Gaming Mouse"
H: Handlers=event2 mouse0

Last edited by lo7777799 (2024-03-31 05:59:20)

Offline

#7 2024-03-30 13:45:03

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

[henni@myhost ~]$ xev -event button | grep button 
    state 0x0, button 9, same_screen YES
    state 0x0, button 9, same_screen YES
    state 0x0, button 8, same_screen YES
    state 0x0, button 8, same_screen YES
    state 0x0, button 8, same_screen YES
    state 0x0, button 8, same_screen YES
    state 0x0, button 8, same_screen YES
    state 0x0, button 8, same_screen YES

8 ist back thumb button and should be shift. 9 should be ctrl.

Last edited by lo7777799 (2024-03-31 05:58:05)

Offline

#8 2024-03-30 14:55:10

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

i have written this in my ~/.xbindkeysrc

"xte 'Shift_L'"
b:8 # Maustaste 8

"xte 'Control_L'"
b:9 # Maustaste 9

but if i click my thumb button i dont have shift left. what is wrong?

Last edited by lo7777799 (2024-03-31 05:57:44)

Offline

#9 2024-03-30 19:02:59

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: mouse buttons config under Xorg and evdev

Please use [code][/code] tags. Edit your posts in this regard.
Also don't bump - edit your previous post to mend it unless somebody has replied.


The "Section "InputDevice"" will not do what you want - it's a legacy and unnecessary attempt to make use of more than three mouse buttons.
Remove that file again.

xte is part of https://archlinux.org/packages/extra/x8 … utomation/ - do you have that installed?
You could also use xdotool etc. but the tool needs to be there.

Editing ~/.xbindkeysrc likewise won't do anything unless you're running the xbindkeys daemon, https://archlinux.org/packages/extra/x86_64/xbindkeys/
You'll also need separate events for "b:8" and "b:8 + Release", binding "xte keydown Shift_L" and "xte keyup Shift_L"

Offline

#10 2024-03-31 05:57:24

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

i have xte.

i have give in terminal

pkill -f xbindkeys 
xbindkeys

is that , what i should reset and start the xbindkeys daemon?

later i want to add the evdev  to my mouse buttons.

Last edited by lo7777799 (2024-03-31 06:04:01)

Offline

#11 2024-03-31 06:49:33

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

# "xdotool key 'm:0x1 + c:50'"
"firefox"
b:8

"xdotool key 'm:0x4 + c:37'"
b:9

with firefox, that works. if i click  mouse button 8, firefox starts.

but ctrl left and shift left does not work.

Offline

#12 2024-03-31 07:40:13

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: mouse buttons config under Xorg and evdev

seth wrote:

xte is part of https://archlinux.org/packages/extra/x8 … utomation/ - do you have that installed?
You could also use xdotool etc. but the tool needs to be there.

Editing ~/.xbindkeysrc likewise won't do anything unless you're running the xbindkeys daemon, https://archlinux.org/packages/extra/x86_64/xbindkeys/
You'll also need separate events for "b:8" and "b:8 + Release", binding "xte keydown Shift_L" and "xte keyup Shift_L"

pacman -Qs 'xdotool|xautomation'
"xdotool keydown Shift_L"
    b:8 # Maustaste 8

"xdotool keyup Shift_L"
    Shift + b:8 + Release # Maustaste 8 loslassen

"xdotool keydown Control_L"
    b:9 # Maustaste 9

"xdotool keyup Control_L"
    Control + b:9 + Release # Maustaste 9 loslassen

I've not tested whether "Shift + " and "Control +" are necessary or rather detremental to this.
Your problem is that you don't want to fire the key straight away, you want to be able to push and hold it w/ the mouse button

Offline

#13 2024-03-31 07:54:13

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

You'll also need separate events for "b:8" and "b:8 + Release", binding "xte keydown Shift_L" and "xte keyup Shift_L"

how should i write that into ~/.xbindkeysrc ?

Offline

#14 2024-03-31 07:55:57

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: mouse buttons config under Xorg and evdev

I posted you an example utilizing xdotool, if you want to use xte use that instead.

Offline

#15 2024-03-31 07:57:15

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

"xdotool keydown Shift_L"
    b:8 # Maustaste 8

"xdotool keyup Shift_L"
    Shift + b:8 + Release # Maustaste 8 loslassen

"xdotool keydown Control_L"
    b:9 # Maustaste 9

"xdotool keyup Control_L"
    Control + b:9 + Release # Maustaste 9 loslassen

it works. thank you very much smile

but how should i let evdev driver handle it? evdev has better reaction times than xorg drivers i read.

Offline

#16 2024-03-31 08:14:47

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

should i write

xbindkeys

into a text file in /home/user to autorun it at every start?

in which? .bashrc or .bash_profile ?

Last edited by lo7777799 (2024-03-31 08:15:45)

Offline

#17 2024-03-31 08:35:43

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: mouse buttons config under Xorg and evdev

but how should i let evdev driver handle it? evdev has better reaction times than xorg drivers i read.

This is a gross misunderstanding of what you're talking about; but if you want to remap the input on a lower layer you'll have to use either a udev rule (as previously linked example) or evrouter.

Don't start x11 stuff in your shell profiles, let alone the bashrc
Autostarting somewhat depends on how you start what GUI session, see the lat three chapters of https://wiki.archlinux.org/title/Autost … nt_startup

Offline

#18 2024-03-31 08:41:36

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

Don't start x11 stuff in your shell profiles, let alone the bashrc

but what should i do, if i want to autostart xbindkeys?  should i write that always in a terminal after starting my pc?

or should i write

systemctl enable xbindkeys.service

?

Last edited by lo7777799 (2024-03-31 08:43:07)

Offline

#19 2024-03-31 08:44:42

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: mouse buttons config under Xorg and evdev

seth wrote:

Autostarting somewhat depends on how you start what GUI session, see the lat three chapters of https://wiki.archlinux.org/title/Autost … nt_startup

Did you bother to click that link?
Or this one, https://slash7.com/2006/12/22/vampires/ ?

Offline

#20 2024-03-31 08:45:38

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

my english is not perfect

Offline

#21 2024-03-31 08:52:40

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

should i write

systemctl enable xbindkeys.service

or something else?

Offline

#22 2024-03-31 09:20:53

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

question?

Offline

#23 2024-03-31 09:30:02

seth
Member
Registered: 2012-09-03
Posts: 53,584

Re: mouse buttons config under Xorg and evdev

https://www.deepl.com/translator

Hast Du auf den link in #17 geclickt, ja oder nein?
Wie startest Du welchen Desktop? Die Antwort auf die Frage leitet Dich dann weiter zu den möglichen Autostart Optionen

Und nein, weder gibt es einen "xbindkeys.service" noch wäre es irgendwie sinnvoll das als systemweiten Dienst laufen zu lassen.

Offline

#24 2024-03-31 09:34:08

lo7777799
Member
Registered: 2023-07-25
Posts: 37

Re: mouse buttons config under Xorg and evdev

ok danke für antwort. smile

ich starte meinen desktop mit lxdm, dem login manager von lxde.

grub ist mein bootloader und mein  initloader ist systemctl.

helfen diese angaben?

Last edited by lo7777799 (2024-03-31 09:34:54)

Offline

#25 2024-03-31 09:41:32

seth
Member
Registered: 2012-09-03
Posts: 53,584

Offline

Board footer

Powered by FluxBB