The answer is: you shouldn't do that.
What you are actually asking for is a way to change highly sensitive system settings by any site without any permission. Which seems to be ridiculous. Simply try to imagine every web-site has it's own "number of lines per notch wheel" setting. Sounds like a hell for anybody.
BTW, this is really bad approach from usability point of view. Anyway, as you have already mentioned this can be done on system level or browser level. For example:
How can i change the number of jumped lines when scrolling?
For the first part of your question concerning scrolling with the
mouse. By default Firefox will uses system settings for deciding how
many lines to scroll when using the mouse wheel, but you can change it
by modifying a couple of hidden preferences.
- Type about:config into the location bar and press enter
- Accept the warning message that appears and a list of preferences will appear
- In the filter box type numlines
- Double-click on the preference mousewheel.withnokey.sysnumlines to change its value to false
- Double-click on the preference mousewheel.withnokey.numlines and
change it to the number of lines you want to scroll
Any browser with the option to silently change a system setting from the outside will be simply dropped.
What you can actually do
You can control all mouse specific parameters when you and only you are responsible for the rendering. Which means with HTML Canvas you can do everything you want.
Some useful examples: