I'm going to tell you my problem and the solution I found:
I want to play with some mods which are mainly about weapons dual wielding them, but sadly I can't use Mine & Blade: Battlegear 2 because the weapons I wanted had actions for both clicks. After giving up on that mod, I decided that quickly changing weapons in the middle of a fight was enough for me.
A normal person would do this with the mouse wheel. #FunFact: mine is broken. But my mouse has 2 buttons on the side (that are buttons 4 and 5, as you might know), so I thought "Why not using those instead of the damned broken wheel?".
It was harder than I expected, then easier than it seemed. I only needed a beautiful program and some basic programming concepts.
5. Open Minecraft and enter a world/server, you should now be able to scroll through the hotbar with buttons 4 and 5. (#4 to the left and #5 to the right, similar to the mouse wheel where down is to the left and up is to the right)
The program will be running until you stop it. To stop the program you can do it from the toolbar or from the task manager.
-When it's running, you won't be able to write a dot nor a comma, even if the settings are set just for the javaw.exe process.
-If you have too much lag (like, around 7 fps) it may not work properly, skipping a slot (or two?) every so often.
-You have to press X amount of times to get to a slot X slots away. (holding doesn't work)
It works independently from other ways of hotbar positioning. If you go to slot Y with the side buttons and then go to slot Z with the Z key or with the wheel, pressing button 4 will take you to slot Y+1, not Z+1.
Why am I posting this if it is not useful less than half of the time/I could just buy another mouse/there's a better way of binding the buttons to scroll?
1) It's the only way to do it I found. If there is a better one, let me know.
2) I want to let this here just in case someone has the same problem. It was hard to find this program and to learn how to use it with almost none programming abilities.
3) If there's no way of binding these buttons to the scroll function (in a Minecraft hotbar-friendly manner) other than with this program, it would be good if someone notices how to fix the little cons this way has.
4) Mouses are expensive.
I'm looking forward to reading the opinions/suggestions/information you can have about the problem or the solution, even improvements to the settings.
I am so glad to read your answer and to know this helped someone! Even after so much time!
Tweak the configs as you please, I encourage you to explore the program to suit it for your needs / likes. (Or even make it better, my lesser brothers are using the computer a lot lately and have just realized they can't type dots or commas right after start hahaha we still haven't got a new mouse. :P)
If you have any more problem, I sure would want to help.
It is interesting there's still no solution to things like this, maybe now I'm a Java pro I can do something about it. (probably won't lol)