Page 1 of 1

Assigning an alternative function to a mouse key

PostPosted: Aug 26th, '17, 06:33
by akbrian
I'm using Mageia 6 and mostly KDE these days.
My wireless mouse is a Logitech M570. My wireless keyboard is a Logitech K360.
Image
In addition to the the standard mouse buttons and scroll wheel it as another pair of buttons. Currently while browsing they function as "back" and "forward'. I would prefer "page up" and "page down".
The upper button is button 9
Code: Select all
$ xev | grep -A 2 Button
ButtonPress event, serial 37, synthetic NO, window 0x7e00001,
    root 0x4b6, subw 0x7e00002, time 1435518974, (34,50), root:(1318,79),
    state 0x0, button 9, same_screen YES
--
ButtonRelease event, serial 37, synthetic NO, window 0x7e00001,
    root 0x4b6, subw 0x7e00002, time 1435519302, (34,50), root:(1318,79),
    state 0x0, button 9, same_screen YES

I want to map it to the page up key on my keyboard
Code: Select all
$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"(Scheme function)"
    m:0x0 + c:112
    Prior

The lower button is button 8
Code: Select all
$ xev | grep -A 2 Button
ButtonPress event, serial 37, synthetic NO, window 0x7e00001,
    root 0x4b6, subw 0x7e00002, time 1435532292, (34,50), root:(1318,79),
    state 0x0, button 8, same_screen YES
--
ButtonRelease event, serial 37, synthetic NO, window 0x7e00001,
    root 0x4b6, subw 0x7e00002, time 1435532534, (34,50), root:(1318,79),
    state 0x0, button 8, same_screen YES

I want to map it to the page down key on my keyboard
Code: Select all
$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"(Scheme function)"
    m:0x0 + c:117
    Next

What's the easiest way to do this?

Re: Assigning an alternative function to a mouse key

PostPosted: Aug 26th, '17, 11:38
by doktor5000
The most portable way would be via xmodmap, see e.g. https://wiki.archlinux.org/index.php/xmodmap
You should also take a look at https://wiki.archlinux.org/index.php/Mo ... d_and_back and the previous part of that wiki page, as it explains the context.