Bug 92127

Summary: Cyborg R.A.T 3/5/7 mapping incorrect, mouse focus locking
Product: Wayland Reporter: Joel Duncan <joel>
Component: libinputAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: joel, peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Rat 5 Current Mapping
Evemu output from RAT 5
attachment-31908-0.html

Description Joel Duncan 2015-09-26 11:25:19 UTC
Cyborg R.A.T 3/5/7 mapping in Libinput is incorrect, after selecting a window you have to use the "Mode" button to un-focus and access another window.

Old fix in X was to add this to its configuration

Section "InputClass"
        Identifier "Mouse Remap"
        MatchProduct "Mad Catz Mad Catz R.A.T.5 Mouse"
        MatchDevicePath "/dev/input/event*"
        Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17"
        Option "ZAxisMapping" "4 5 6 7"
        Option "AutoReleaseButtons" "13 14 15"
EndSection
Comment 1 Peter Hutterer 2015-12-03 04:43:03 UTC
can you give me a list of the various buttons and what they're supposed to do please? Specifically, what EV_KEY event they send (check evemu-record, and attach the output from evemu-describe please)

AutoReleaseButtons doesn't exist in the upstream driver, which distro is this from?
Comment 2 Peter Hutterer 2016-01-27 06:01:27 UTC
ping?
Comment 3 Joel Duncan 2016-01-27 22:04:12 UTC
Created attachment 121334 [details]
Rat 5 Current Mapping
Comment 4 Joel Duncan 2016-01-27 22:04:46 UTC
Created attachment 121335 [details]
Evemu output from RAT 5
Comment 5 Joel Duncan 2016-01-27 22:09:53 UTC
My apologies I must of missed the email reminder! Thanks for the ping.

I've attached what you've requested.

The work-around I posted worked on Fedora 21, Although thinking about it I'm not sure if the AutoReleaseButtons worked at the time.

It may of stopped working on Fedora 22.

But the rest of the config did.

Thanks
Comment 6 Peter Hutterer 2016-01-28 05:50:09 UTC
ok, I'm trying to be understand this: left/middle/right works fine. back/forward buttons should work fine too. vertical scroll should work fine too.

what is a horizontal scroll sends button events. Is this the thumb wheel? I'm a bit hesitant to force this to be a horizontal scroll wheel in software, doing so would disallow any other button mapping.

the other buttons should just be mapped to higher buttons too. I'm a bit confused what you meant with pressing the mode button, and the AutoReleaseButton bit - from the evemu recording it looks like all buttons release correctly. What's the exact issue here? does the mode button even show up in evemu?

so from your original config, that leaves me with: you're mapping the thumb wheel buttons to horizontal scrolling. and as I said above, I'm hesitant to hard-code this in for this device.
Comment 7 Joel Duncan 2016-01-28 20:19:56 UTC
Yep they all work.

The side scroll is a physical thumb wheel.

I think I see the problem heres the output of the mode button:

E: 0.000001 0004 0004 589833	# EV_MSC / MSC_SCAN             589833
E: 0.000001 0001 0118 0000	# EV_KEY / (null)               0
E: 0.000001 0004 0004 589834	# EV_MSC / MSC_SCAN             589834
E: 0.000001 0001 0119 0001	# EV_KEY / (null)               1
E: 0.000001 0000 0000 0000	# ------------ SYN_REPORT (0) ---------- +0ms

Here it is pushed 3 times as it has 3 modes:

E: 0.000001 0004 0004 589833	# EV_MSC / MSC_SCAN             589833
E: 0.000001 0001 0118 0000	# EV_KEY / (null)               0
E: 0.000001 0004 0004 589834	# EV_MSC / MSC_SCAN             589834
E: 0.000001 0001 0119 0001	# EV_KEY / (null)               1
E: 0.000001 0000 0000 0000	# ------------ SYN_REPORT (0) ---------- +0ms
E: 0.705000 0004 0004 589834	# EV_MSC / MSC_SCAN             589834
E: 0.705000 0001 0119 0000	# EV_KEY / (null)               0
E: 0.705000 0004 0004 589835	# EV_MSC / MSC_SCAN             589835
E: 0.705000 0001 011a 0001	# EV_KEY / (null)               1
E: 0.705000 0000 0000 0000	# ------------ SYN_REPORT (0) ---------- +705ms
E: 1.496995 0004 0004 589833	# EV_MSC / MSC_SCAN             589833
E: 1.496995 0001 0118 0001	# EV_KEY / (null)               1
E: 1.496995 0004 0004 589835	# EV_MSC / MSC_SCAN             589835
E: 1.496995 0001 011a 0000	# EV_KEY / (null)               0
E: 1.496995 0000 0000 0000	# ------------ SYN_REPORT (0) ---------- +791ms
Comment 8 Peter Hutterer 2016-01-28 22:14:35 UTC
ok, this shows the problem: the button when physically pressed sends a release event for the current mode, then a press event for the new mode which is logically held down until the next press of that button.

are these mode buttons actually mapped to/used for anything? I'm wondering whether it's better to disable them altogether and (later) map them into a switch system rather than a normal set of buttons.
Comment 9 Joel Duncan 2016-01-28 22:24:12 UTC
Created attachment 121371 [details]
attachment-31908-0.html

That makes sense.

Personally I think the button is pretty redundant in Linux without the use
of there software.
It's used to switch DPI and pre-set mouse mapping set in their proprietary
software Windows/Mac only.

I've never used it in the 4 years of having the mouse and caused nothing
but issues in all Linux distros.

Although it would be nice to have the thumb wheel working

--

Joel Duncan
Co-Founder - The Scripthen Network
Mobile: +07858949280
WebSite <http://www.slethen.net/> | GPG Key <https://slethen.net/gpg.asc> |
Blog <https://blog.slethen.net>



On Thu, Jan 28, 2016 at 10:14 PM, <bugzilla-daemon@freedesktop.org> wrote:

> *Comment # 8 <https://bugs.freedesktop.org/show_bug.cgi?id=92127#c8> on
> bug 92127 <https://bugs.freedesktop.org/show_bug.cgi?id=92127> from Peter
> Hutterer <peter.hutterer@who-t.net> *
>
> ok, this shows the problem: the button when physically pressed sends a release
> event for the current mode, then a press event for the new mode which is
> logically held down until the next press of that button.
>
> are these mode buttons actually mapped to/used for anything? I'm wondering
> whether it's better to disable them altogether and (later) map them into a
> switch system rather than a normal set of buttons.
>
> ------------------------------
> You are receiving this mail because:
>
>    - You reported the bug.
>    - You are on the CC list for the bug.
>
>
Comment 10 Joel Duncan 2016-01-28 22:28:18 UTC
Comment on attachment 121371 [details]
attachment-31908-0.html

><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#073763">That makes sense.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#073763"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#073763">Personally I think the button is pretty redundant in Linux without the use of there software.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#073763">It&#39;s used to switch DPI and pre-set mouse mapping set in their proprietary software Windows/Mac only.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#073763"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#073763">I&#39;ve never used it in the 4 years of having the mouse and caused nothing but issues in all Linux distros. </div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#073763"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#073763">Although it would be nice to have the thumb wheel working</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div style="font-size:16px;font-family:helvetica"><font color="#3d85c6">--</font></div><div style="font-size:16px;font-weight:bold;font-family:helvetica"><br></div><div style="font-size:16px;font-weight:bold;font-family:helvetica">Joel Duncan</div><div style="font-family:helvetica;font-size:12px;color:rgb(153,153,153)">Co-Founder - The Scripthen Network</div><div style="font-family:helvetica;font-size:12px;color:rgb(153,153,153)"><a href="http://www.slethen.net/" style="color:rgb(47,151,255);text-decoration:initial" target="_blank">WebSite</a> | <a href="https://slethen.net/gpg.asc" style="color:rgb(47,151,255);text-decoration:initial" target="_blank">GPG Key</a> | <a href="https://blog.slethen.net" style="color:rgb(47,151,255);text-decoration:initial" target="_blank">Blog</a></div></div><div style="font-family:helvetica;font-size:12px;color:rgb(153,153,153)"><br></div><div style="font-family:helvetica;font-size:12px;color:rgb(153,153,153)"><img src="https://cloud.slethen.net/index.php/s/pvf10aevHMup2xE/download" width="200" height="86"><br></div><div style="font-family:helvetica;font-size:12px;color:rgb(153,153,153)"></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
><br><div class="gmail_quote">On Thu, Jan 28, 2016 at 10:14 PM,  <span dir="ltr">&lt;<a href="mailto:bugzilla-daemon@freedesktop.org" target="_blank">bugzilla-daemon@freedesktop.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
>    
>      
>    
>    <div>
>      <p>
>        </p><div>
>            <b><a title="NEEDINFO - Cyborg R.A.T 3/5/7 mapping incorrect, mouse focus locking" href="https://bugs.freedesktop.org/show_bug.cgi?id=92127#c8" target="_blank">Comment # 8</a>
>              on <a title="NEEDINFO - Cyborg R.A.T 3/5/7 mapping incorrect, mouse focus locking" href="https://bugs.freedesktop.org/show_bug.cgi?id=92127" target="_blank">bug 92127</a>
>              from <span><a href="mailto:peter.hutterer@who-t.net" title="Peter Hutterer &lt;peter.hutterer@who-t.net&gt;" target="_blank"> <span>Peter Hutterer</span></a>
></span></b>
>        <pre>ok, this shows the problem: the button when physically pressed sends a release
>event for the current mode, then a press event for the new mode which is
>logically held down until the next press of that button.
>
>are these mode buttons actually mapped to/used for anything? I&#39;m wondering
>whether it&#39;s better to disable them altogether and (later) map them into a
>switch system rather than a normal set of buttons.</pre>
>        </div>
>      <p></p><span class="">
>      <hr>
>      <span>You are receiving this mail because:</span>
>      
>      </span><ul>
>          <li>You reported the bug.</li><span class="">
>          <li>You are on the CC list for the bug.</li>
>      </span></ul>
>    </div>
></blockquote></div><br></div>
Comment 11 Peter Hutterer 2016-01-29 00:22:33 UTC
Joel: please disable html mail when you're replying to bugzilla, it gets a bit confusing :)

In your first comment you mentioned this affects the rat 3 and 7 models as well. Do you have the vendor/product ids for those (evemu shows them) and do you know if they use the same event codes?
Comment 13 Joel Duncan 2016-01-29 00:58:45 UTC
Yep sorry about that! Accidently replied through gmail, then proceeded to break things attempting to remove my mobile number.

The RAT 3 & 5 seem to have the same vendor ID. No idea about the RAT 9 but the button layout is the same, and from configs I've seen online it appears to be the same but I have no way of testing.

I'll give that patch ago, thanks! :)
Comment 14 Peter Hutterer 2016-01-29 04:44:29 UTC
the problem is that for the patch I need the vendor and product ID so I can match on the specific devices. If you can get those, that'd be much appreciated.


RAT 7 is 0xccb based on https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/615892
RAT 3 is 0xccc based on http://www.lgqyc.com/cyborg-r-a-t-3-gaming-mouse-stops-working-after-a-while-and-or-misbehaves/

can you confirm that? and do they send the same event codes?
Comment 15 Peter Hutterer 2016-02-01 06:39:44 UTC
commit e19d5d228cbda3ccd0fe1f11948032e12e1ed3c3
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Fri Jan 29 10:09:13 2016 +1000

    evdev: disable the mode button on the Cyborg RAT 5

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.