I use X-Mouse Button control , to bind some hotkeys to my mouse , the use of this software is not ilegal , the ilegal thing can be how you use it. With this I mean for example if you bind a task in a hotkey you can get ban , for example ( {F10}{DELAY10}{F2}) a script command like this binded in a key or hotkey is a cause of ban.
So to answer your question , the software is legal but depending on the use of it.