Cool, that’s great to hear. Your mouse lacking these buttons also explains why it’s not implemented. Mouse4 and Mouse5 are the buttons at the thumb, one is for forward and one for backward. This is standard functionality under Windows and Linux, for file browsers, web browsers, Sublime Text, Visual Studio Code, Pycharm etc. For the text editors it switches between opened files. For Pycharm it’s even cooler. If you click on the method name of a function call for example, it takes you to the definition of the function. Regardless if it’s in the same file or not. By pressing Mouse5 (backward), you jump back to the original function call. That makes it handy for programming, but that’s just my preference.
By standard I mean it works out of the box with any USB mouse you connect with any of the before mentioned software, without configuration. Since you implemented the functionality already, it should be sufficient to add a hook for these two events and then call the other method. How exactly this is done might be of course messy. But Visual Studio Code works too and that is based on Electron. So there must be a way.