a4tech-bloody-linux-driver
a4tech-bloody-linux-driver copied to clipboard
Read DPI value
Is there a way to read DPI value? I know that it's mouse that sends dpi+/dpi-, but original software must somehow read initial value
Yes.
This seems to be the query code on my P85 -
0702002a006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
However decoding the response is gonna take me a bit. It seems like the response is current mode + all possible modes.
You can watch my progress here as I forked this repo due to my mouse working a bit different than others supported in this repo.
https://gitlab.com/C0rn3j/a4tech_bloody_p85_driver
I know that it's mouse that sends dpi+/dpi-,
The bloody software can also set the DPI.
I figured enough to show current DPI. Still trying to figure out those 8 magic bytes that change with any change of anything, so likely no possibly to set DPI with this, but enough to get and display it.
0702002a00600000a4a4915be9460000040001001614161400002e282e280000453c453c00005c505c5000007364736400000000000000000000000000000000 # 1000 [2000] 3000 4000 5000
####-------- ## #! 11111111 22222222 33333333 44444444 55555555
#### - Seems to always be a4a4 when getting and ffff when setting
-------- - No idea how this changes. It gives deterministic results though, it always changes the same depending on the mode/settings
Second byte = X + [mode number]
Fifth byte = Y + [mode number*5]
## - How many more modes are active. Goes from 0 to 4. (meaning 1 total, 2 total, ....)
#! - Selected mode, goes from 0 to 4.
111111 - First mode
222222 - second mode etc.
a hundred Hz increment is 02020202 in hex, but the base hex value of the initial 100Hz is 01020102
EDIT: Nevermind actually, this seems to only get settings saved to the memory, not current settings.
Ok so apparently you cannot get current DPI set on the mouse.
Bloody software simply sets DPI to whatever it was last time you ran the software and afterwards it listens for any changes from the mouse.
It "reads" the initial value by setting some.
07010100000007000003e801030100006b246ff007470dc72c68245f11f4017725c8f4f004b0b0bd6f3d610a00026543dbb9cecad066f9887d73d1bd8915f665
07010100000007000003e801040100006b246ff007470dc72c68245f11f4017725c8f4f004b0b0bd6f3d610a00026543dbb9cecad066f9887d73d1bd8915f665
##