Scyrox mouse battery indicator banner

Scyrox mouse battery indicator

5 devlogs
10h 7m 45s

Rust project to log my mouse battery directly into windows system tray and windows notification system for low battery notifications.

Ritonton

I went in a completely different direction to avoid reading when the mouse is inactive and improve my reading performance, because previously, with battery readings every 300 seconds, the probability of this reading occurring while the mouse is active (moved less than 15 seconds before) is quite low during office work (mouse often on the side to access the keyboard). Now the app tracks mouse activity in a highly optimised way so that it only reads when there is movement or waits for movement to read.
It took a long time to find the right way to do this, because there are many ways and each has its advantages and disadvantages. In the end, I went with this option: We track activity with the WM_INPUT hook. WM_INPUT cannot read activity if the foreground app is running as an administrator, which is why I also use cursor position variation as a fallback.
In short, it’s coming together nicely in an app that will soon be finished. I’m going to start working on the release repo. I prefer to work with release repos and publish in one big commit because it’s cleaner during POC and testing periods… and I have my personal repo for developing version 1 of the product!

Attachment
0
Ritonton

It now supports when the mouse is sleeping and it is now integrated with the windows notification system to alert the user also when the battery drop below 20% it starts notifying at 10%, 5%, and when near shutdown.

Attachment
0
Ritonton

The tray app is now operational and displays the battery status in the tooltip. I exported the Fluent icons for the battery indicator from the Microsoft repository, and in the next devlog, I will ensure that the status bar icon changes dynamically based on the battery level and mouse status (normal, inactive, and charging).
WIP

Attachment
Attachment
0
Ritonton

First devlog!
So far, I’ve finished the part that connects the mouse with hidapi. I reverse-engineered the Scyrox web configurator by unminifying their main js file and transposed the battery percentage calculation logic into Rust using smoothed voltage interpolation. It handles the mouse’s sleep state and issues alerts when it is asleep, charging, or below 20%. What I have left to do now is call the Windows notification system to display them before moving on to integration into the windows’s system tray.

Attachment
0