libratbag / piper

GTK application to configure gaming devices
GNU General Public License v2.0
4.79k stars 177 forks source link

Add Volume Up / Volume Down for action buttons #855

Closed KierPrev closed 1 year ago

KierPrev commented 1 year ago

It is very useful for people that doesn't have volume control on their keyboard.

staticssleever668 commented 1 year ago

See https://github.com/libratbag/piper/issues/683#issuecomment-1456856759, it works with sinowealth at the very least :)

(note: only works on libratbag-git right now, this will be in libratbag v0.18). E.g. ratbagctl Sinowealth button 5 action set key KEY_VOLUMEUP.

Closing as duplicate: #683.

KierPrev commented 1 year ago

Thanks! Do you have to specify the sinowealth device model? It doesn't find the device Or maybe it doesn't work the yesterday git version

staticssleever668 commented 1 year ago

You should replace Sinowealth with what gets printed by ratbagctl list, either the left or right part. For example:

ratbagctl list
# > warbling-mara:       Glorious Model O

So I can use ratbagctl warbling-mara or ratbagctl Glorious or ratbagctl "Glorious Model O"

staticssleever668 commented 1 year ago

That's odd, does ratbagctl return an error? If not, could you post the output of sudo ratbagd --verbose=raw when you run the command?

KierPrev commented 1 year ago

Thanks! I made it work with the macro. The side buttons were 3 and 4.

KierPrev commented 1 year ago

I'm glad that this will be on v0.18 :)

staticssleever668 commented 1 year ago

By the way, one unrelated question: in configuration utility for your mouse, can you disable the second profile in any way? Like, could you have the key binding for changing profiles be enabled, but at the same time be unable to switch to the second profile with it?

KierPrev commented 1 year ago

On the windows utility, I could add a mouse button for changing the profiles, and it would change. On Piper, I can do the same. But on Piper, I cannot see the second profile config in the GUI, nor set a default one when booting up.

If I didn't answer your question, or want me to do some testing, just tell me.

staticssleever668 commented 1 year ago

That's exactly what I wanted to hear, thank you!

On Piper, I can do the same.

This action actually doesn't work because it's disabled on driver side with a compile option, but..

But on Piper, I cannot see the second profile config in the GUI, nor set a default one when booting up.

along with this, you can enable functionality by changing #define SINOWEALTH_NUM_PROFILES 1 to #define SINOWEALTH_NUM_PROFILES 2 in src/driver-sinowealth.c in libratbag's source code.

The reason it's not enabled by default is basically described in the comment right above the assignment, but along with that I didn't test it too much, although I don't think there should be any critical problems. For me I have witnessed following: 1) Active DPI slot selection work incorrectly in the second profile. This is very strange, since there isn't anything profile-specific in the configuration data for this, and when I read data from the mouse, it shows me the correct thing, but it still uses the incorrect one. 2) Once the second profile has reset to what it was from factory, and on Glorious Model O it's an empty profile without any buttons assigned, which makes the mouse unusable until you change the profile. I think the official software utility did this, as I have used it from time to time to check some things, but I don't know for sure.


I would want to enable the second profile one day if I find a way to fix these issues, but I also can't do it until I can reliable check how many profiles does the mouse support, because there are even some SinoWealth mice with support for three profiles.

KierPrev commented 1 year ago

The GUI of the mouse showed 2 profiles. And only 2. https://youtu.be/gBv8z2O5jFk?t=223

That is NOT my mouse (my DPIs were different), but the software IS the same, and it doesn't change from mouse to mouse in this brand.

The only difference would be the button's number and the DPIs. The rest is the same.

KierPrev commented 1 year ago

Wait, I think I'm confusing profiles and modes (2 per profile). I'm a little confused, but maybe you'll know better.

staticssleever668 commented 1 year ago

Oh, so it also has two modes per profile? That's interesting. Now that I look at configuration data of your mouse, it really does seem like there is more stuff than I expected, at least in the button configuration data. Thank you! I will take a look this at this later. Edit: wait, I was looking at the wrong thing, I don't actually see anything unusual, so there is nothing for me to check... Either way, thank you for the information, I'll keep this in mind for future.

KierPrev commented 1 year ago

No, thanks to you! At least I can fully configure my mouse with this utility :)