I've recently purchased the Utechsmart Venus mouse: http://www.utechsmart.com/product/show/id/477/US-D16400-GM
I've been unable to bind those side buttons (and the "rapid fire button near the left mouse button) to different keys without changing the keys the side and rapidfire buttons point to.
The reason for this is that I've been unable to actually get xev to recognize the side and rapid fire buttons as their own event. Instead, when I press a side button or rapid fire button, the xev event tester immediately reports the binding that the button is mapped to.
I.e. I press side button "1", event mapper reports:
KeyPress event, serial 74, . . .
KeyRelease event, serial 74 . . .
When I press the left mouse button the mapper reports:
ButtonPress event, serial 37, . . .
Button Release event, serial 37, . . .
Obviously I can't map the button from the mouse if its not telling me what the button "address" is as in these two related posts:
How to configure extra buttons in Logitech Mouse
Mouse shortcuts get confused with keyboard keys in Kubuntu
Does anyone have any advice to further try and find out what these buttons are on the mouse?
Obviously the mouse is working, its just not mapped to buttons in a way that I would prefer. Therefore it seems to me that there must to be a solution to this, and I'd be more than happy to dive quite deeply to solve this problem. I've been looking at the documentation for Xorg and evdev drivers, but I'm not even certain if that's the correct direction.
Not necessarily looking for someone to solve this problem directly for me. But helping me to brainstorm for some ideas about how to go about solving this problem would be greatly appreciated.
Thanks for your patience!
UPDATE:
So I've found a post on archlinux forums about the razer naga which is a very similar mouse. It seems hopeful: https://bbs.archlinux.org/viewtopic.php?id=145502. That lead me to a similar problem with infrared remote controls here: https://www.mythtv.org/wik147+853!#@#+!i/Generic_HID_%22MCE%22_Remotes#XKB_Remapping. There is a wealth of information there that goes into decent depth about the issue. It would be nice if they explained better how they figure out what the "keys" are in the scripts, but after reading a lot of the suplementary material it seems that the <AE[01/12]> is coming from convention (and since the buttons on the mouse correspond to those key mappings it only makes further sense. . .
However, I'm still having a bit of an issue. I haven't created a shebang yet, instead I've just tried to run the command by hand.
First I created the symbols file /usr/share/X11/xkb/symbols/custom (I'm not quite sure why they're using the tmp directory) and included the following:
xkb_symbols "venus" {
2 key <AE01> { [ y, Y ]
3 key <AE02> { [ i, I ]
4 key <AE03> { [bracketleft, braceleft ]
5 key <AE04> { [bracketright, braceright ]
6 key <AE05> { [ slash, question ]
7 key <AE06> { [ j, J ]
8 key <AE07> { [ k, K ]
9 key <AE08> { [ l, L ]
10 key <AE09> { [ semicolon, colon ]
11 key <AE10> { [ comma, less ]
12 key <AE11> { [ minus, underscore ]
13 key <AE12> { [ equal, plus ]
14 };
Then I ran xinput list which yeilded:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ USB Laser Game Mouse id=9 [slave pointer (2)]
⎜ ↳ USB Laser Game Mouse id=11 [slave pointer (2)]
⎜ ↳ EST Gaming keyboard id=13 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ USB Laser Game Mouse id=10 [slave keyboard (3)]
↳ EST Gaming keyboard id=12 [slave keyboard (3)]
↳ EST Gaming keyboard id=14 [slave keyboard (3)]
↳ C-Media Electronics Inc. USB Audio Device id=15 [slave keyboard (3)]
↳ USB Laser Game Mouse id=16 [slave keyboard (3)]
↳ EST Gaming keyboard id=17 [slave keyboard (3)]
After analyzing the script written in the two links above, I deduced that my $remote_id variable would be 16 so I ran the following:
setxkbmap -device 16 -print | sed's/\(xkb_symbols.*\)"/\1+custom(venus)"/' | xkbcomp -I /usr/share/X11/xkb -i 16 -synch $DISPLAY
I did not pipe my output into /dev/null because I wanted to see what the output would be (obviously when I make the script, then I will do this, but I'm trying to understand what I'm doing at the moment). My output was the following:
Warning: Too many file names on command line
Compiling /usr/share/X11/xkb, writing to -, ignoring :0
syntax error: line 1 of /usr/share/X11/xkb
last scanned symbol is:
Errors encountered in /usr/share/X11/xkb; not compiled.
I'm not really sure where to go from here. . .
If you're using Ubuntu it seems there is a ppa available: https://launchpad.net/openrgb (I'm not sure if that's enough info for adding a ppa, I don't use Ubuntu).
Unfortunately if you're using a distribution not based in Arch or Ubuntu, then it looks like you might have to compile it from source.
Just hoping to give you an idea.
– Nicholas R Oct 12 '20 at 17:01