Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugin-volume: add support for hires wheel
Some mouses send a lot of events with "small" movement of the wheel. This invalidate some evaluation of the total stroke of the wheel. In the Volume Control plugin, the volume was computed on the basis of the following formula: new_volume = old_volume + event->angleDelta().y() / QWheelEvent::DefaultDeltasPerStep * volumeSlider->singleStep() However if event->angleDelta().y() is smaller than QWheelEvent::DefaultDeltasPerStep, their ratio is a value less than 1, which is zero when the math is integer based. To avoid this issue the volumeSlider->singleStep() will be increased by a factor of 1000 and the multiplication will be performed before the division. Of course all others computation will be scaled according: - the range of the volume slider will be 0..100*1000 (where previous was 0..100) - the volume will be computed as: volume = slider->value() / 1000 - slider->singleStep will be increased by a factor of 1000
- Loading branch information