I found a palliative solution that monitors the volume change of the system itself. When the volume decreases, for example from 10 to 9, the program resets the volume back to 10 (pretending there was no change in volume) and performs the desired action (idem for when the volume increases).
This solution works on several devices, but I find this solution a bit "gambiarra".
Does anyone know a mode, which does not involve root or custom ROMS, to monitor and handle physical volume keystrokes with the screen locked from a service?
Thanks everyone!
Update
Solution types like the one GravityBox uses only work if the device is root. However, I would like something as similar as possible: