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, you should now be able to scroll through the hotbar with buttons 4 and 5. (#4 to the left #5 to the right, similar to the mouse wheel where up is to the right and down is to the left)
The program will be running until you stop it. To stop the program you can do it from the task manager or from the toolbar.
-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) Mice are expensive.
Sorry if I posted this in the wrong place or if I had some misspelling. I'm looking forward to reading the opinions/suggestions/information you can have.