Page 1 sur 1

xbindkeys - attribution de fonctions aux boutons souris

Posté : ven. 8 janv. 2021 17:23
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

Re: xbindkeys - attribution de fonctions aux boutons souris

Posté : ven. 8 janv. 2021 18:16
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

Re: xbindkeys - attribution de fonctions aux boutons souris

Posté : ven. 8 janv. 2021 18:54
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

Re: xbindkeys - attribution de fonctions aux boutons souris

Posté : ven. 8 janv. 2021 19:29
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

Re: xbindkeys - attribution de fonctions aux boutons souris

Posté : sam. 9 janv. 2021 12:21
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...

Re: xbindkeys - attribution de fonctions aux boutons souris

Posté : dim. 10 janv. 2021 16:54
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

Re: xbindkeys - attribution de fonctions aux boutons souris

Posté : ven. 19 mars 2021 05:46
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 ;)