En cours xbindkeys - attribution de fonctions aux boutons souris

Questions concernant les composants
Répondre
Salx
Messages : 9
Enregistré le : jeu. 7 janv. 2021 23:18

xbindkeys - attribution de fonctions aux boutons souris

Message par Salx »

Bonjour à tous,

Je suis en phase de test de LMDE4.

En parallèle à mon sujet viewtopic.php?f=33&t=17297&p=189768#p189768 je cherche à faire fonctionner ma souris Logitheque M560 avec xbindkeys. Je veux retrouver les boutons "précédent" et "suivant" par action latérale de la molette que j'ai sous LMDE2.

J'ai donc modifier (Si j'utilise LMDE depuis ses débuts, je ne suis pas très fort en manipulation) un fichier ".xbindkeysrc" que voici :

Code : Tout sélectionner

###########################
# xbindkeys configuration #
###########################
#
# Version: 0.1.3
#
# If you edit this, do not forget to uncomment any lines that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h 
# The XK_ is not needed. 
#
# List of modifier (on my keyboard): 
#   Control, Shift, Mod1 (Alt), Mod2 (NumLock), 
#   Mod3 (CapsLock), Mod4, Mod5 (Scroll). 
#
# Another way to specifie a key is to use 'xev' and set the 
# keycode with c:nnn or the modifier with m:nnn where nnn is 
# the keycode or the state returned by xev 
#
# This file is created by xbindkey_config 
# The structure is : 
# # Remark 
# "command" 
# m:xxx + c:xxx 
# Shift+... 

#keystate_numlock = enable
#keystate_scrolllock = enable
#keystate_capslock = enable

# Molette gauche => Precedent
"xte 'Alt+Mod2 + Left'"
   b:6

# Molette droit => suivant
"xte 'Alt+Mod2 + Right'"
   b:7

# Bouton central => menu
"xte 'Mod2+Mod4 + Super_L'"
   b:2

#
# End of xbindkeys configuration
qui fonctionne avec xbindkeys -v du moins il se passe quelque chose !

Code : Tout sélectionner

xx@xxxxxxxxx:~$ xbindkeys -v
displayName = :0
rc file = /home/sa/.xbindkeysrc
rc guile file = /home/sa/.xbindkeysrc.scm
getting rc guile file /home/sa/.xbindkeysrc.scm.
WARNING : /home/sa/.xbindkeysrc.scm not found or reading not allowed.
3 keys in /home/sa/.xbindkeysrc

min_keycode=8     max_keycode=255 (ie: know keycodes)
"xte 'Alt+Mod2 + Left'"
    m:0x0 + b:6   (mouse)
"xte 'Alt+Mod2 + Right'"
    m:0x0 + b:7   (mouse)
"xte 'Mod2+Mod4 + Super_L'"
    m:0x0 + b:2   (mouse)
starting loop...
Button press !
e.xbutton.button=6
e.xbutton.state=16
"xte 'Alt+Mod2 + Left'"
    m:0x0 + b:6   (mouse)
got screen 0 for window 11a
Start program with fork+exec call
Button release !
e.xbutton.button=6
e.xbutton.state=16
Unknown command 'Alt+Mod2 + Left'
Button press !
e.xbutton.button=7
e.xbutton.state=16
"xte 'Alt+Mod2 + Right'"
    m:0x0 + b:7   (mouse)
got screen 0 for window 11a
Start program with fork+exec call
Button release !
e.xbutton.button=7
e.xbutton.state=16
Unknown command 'Alt+Mod2 + Right'
Button press !
e.xbutton.button=2
e.xbutton.state=16
"xte 'Mod2+Mod4 + Super_L'"
    m:0x0 + b:2   (mouse)
got screen 0 for window 11a
Start program with fork+exec call
Unknown command 'Mod2+Mod4 + Super_L'
Button release !
e.xbutton.button=2
e.xbutton.state=528
Mais inopérant en dehors du terminal.

Si un habitué de xbindkeys sous LMDE4 peu m'aider, il sera le bienvenu.

Bonne soirée

Serge
Pc : Gigabyte model: B85M-HD3 | LinuxMint 2 betsy | MATE 1.18.0 | 3.16.0-11-amd64 x86_64 (64 bit) | Quad core Intel Core i5-4460 (-MCP-) | 3814.9MB | Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller

Salx
Messages : 9
Enregistré le : jeu. 7 janv. 2021 23:18

Re: xbindkeys - attribution de fonctions aux boutons souris

Message par Salx »

J'ai trouvé une autre façon d'écrire qui fonctionne :

Code : Tout sélectionner

# Molette gauche => Precedent
#"xte 'Alt+Mod2 + Left'"
#  b:6

# Molette droit => suivant
#"xte 'Alt+Mod2 + Right'"
#  b:7

# Bouton central => menu
"xte 'Mod2+Mod4 + Super_L'"
   b:2

"xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"
b:6
"xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'"
b:7 
Par contre j'aimerais bien la comprendre pour assigner les 3 boutons restant.

Bonne soirée

Serge
Pc : Gigabyte model: B85M-HD3 | LinuxMint 2 betsy | MATE 1.18.0 | 3.16.0-11-amd64 x86_64 (64 bit) | Quad core Intel Core i5-4460 (-MCP-) | 3814.9MB | Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller

Avatar du membre
Nerva
Messages : 376
Enregistré le : lun. 4 mars 2019 18:48

Re: xbindkeys - attribution de fonctions aux boutons souris

Message par Nerva »

Si ça peut aider, j'ai également une M560 :

Code : Tout sélectionner

###########################
# xbindkeys configuration #
###########################

# Version: 0.1.3
 
#keystate_numlock = enable
#keystate_scrolllock = enable
#keystate_capslock = enable

# Début
"xte 'key Home'"
b:6

# Fin
"xte 'key End'"
b:7

# Précédent
"xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"
b:11

# Suivant
"xte 'keydown Alt_L' 'key Right' 'keyup Alt_L'"
b:10

# Fermer
"xte 'keydown Control_L' 'key w' 'keyup Control_L'"
b:2

# End of xbindkeys configuration
Linux Mint 21.3 Virginia | Cinnamon 6.0.4

Salx
Messages : 9
Enregistré le : jeu. 7 janv. 2021 23:18

Re: xbindkeys - attribution de fonctions aux boutons souris

Message par Salx »

@Nerva : merci de ta réponse.

Je vois que j'ai appliqué la même syntaxe que toi.

As tu utilisé Xbindkeys-config ou modifié le fichier manuellement ?

J'aimerais bien trouver les règles de cette syntaxe.

Bonne soirée

Serge
Pc : Gigabyte model: B85M-HD3 | LinuxMint 2 betsy | MATE 1.18.0 | 3.16.0-11-amd64 x86_64 (64 bit) | Quad core Intel Core i5-4460 (-MCP-) | 3814.9MB | Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller

Avatar du membre
Nerva
Messages : 376
Enregistré le : lun. 4 mars 2019 18:48

Re: xbindkeys - attribution de fonctions aux boutons souris

Message par Nerva »

J'avais utilisé l'application mais terminé le fichier à la main car je n'obtenais pas ce que je voulais. Je me souviens également d'une page qui répertoriait les codes, mais alors où, je ne sais plus...
Linux Mint 21.3 Virginia | Cinnamon 6.0.4

Salx
Messages : 9
Enregistré le : jeu. 7 janv. 2021 23:18

Re: xbindkeys - attribution de fonctions aux boutons souris

Message par Salx »

Bonjour à tous,

Merci pour ta réponse @Nerva.

Mes boutons précédent et suivant fonctionnent enfin.

Par contre ma simulation de la touche Super (Windows) (qui ouvre le menu) ouvre bien le menu mais les éléments du menu ne sont pas fonctionnels ???

Bonne soirée

Serge
Pc : Gigabyte model: B85M-HD3 | LinuxMint 2 betsy | MATE 1.18.0 | 3.16.0-11-amd64 x86_64 (64 bit) | Quad core Intel Core i5-4460 (-MCP-) | 3814.9MB | Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller

Avatar du membre
alain
Administrateur du site
Messages : 14807
Enregistré le : dim. 11 oct. 2015 23:41
Localisation : Chelles
Contact :

Re: xbindkeys - attribution de fonctions aux boutons souris

Message par alain »

Bonjour.

Sujet archivé (en lecture seule) car 2 mois sans réponse.
Si besoin de rouvrir faire un MP à un membre de l'équipe ;)
PC are like air conditioning, they becomes useless when you open Windows (L.T)
PC1 : CM : ASRock 990FX | CPU: AMD FX 8350-8 cores, 4 GHz | RAM: 16 Go DDR3 1600 MHz | CG: ATI RX 580-8 Go | OS : LM 20.3 Uma Xfce 4.16 | K: 5.4
PC2
:Core2 Quad Q9650 @ 3 GHz | CG: Nvidia GTX 650TI | OS: LM 21.3 Xfce 4.18| K: 6.5
PC3 :Core i7-2600 @ 3,5 GHz | CG: ATI HD 4650 | OS: Emmade5 Xfce 4.18.0 | K: 6.1
PC4 : AMD Ryzen 5 3500X 4GHz | CG: GTX 970 | Ram : 8GB |OS : Debian 10.5 | K: 5.10
In a world without walls and fences, who needs windows and gates?

Répondre