HIDMacros is a small program that assigns macros to buttons - and mouse vents - depending on the device HID id.
It has its limits - mainly, he can't switch gears depending on the Windows you are working on.
To juggle around it, I have built a small (big, nowadays) Java "Daemon" that keeps a repository of configuration files (with backups and the possibility of defining forks for specific uses).
It has been a lot of work - sheesh.
Anyway, if you like "Single button" shortcuts, the combination can be useful.
HIDMacros was written in TurboDelphi, and its author (Petr Medek) has decided to drop it, as TurboDelphi has been reverted to commercial software (from freeware that it was).
It has switched to a new project, called "LuaMacros", that has no graphic user interface to speak of and does not handle some inputs like midi instruments (oh, well) and mouses (what? damn).
I have made my stupid Daemon as simple as possible, and learned what I could from it, but I think that this is the end of the line.
I posted a last version of it in a Dropbox folder, https://www.dropbox.com/sh/ul13bv7xy86pxkg/AACuTFcLK-JcTZDFOFC86CVMa?dl=0
, along with a "turn-key" zip with a clean instance of HIDMacros.
In the long run, if I have time, I will probably build a "Universal HID-devices Handler", that does what HIDMacros do but a bit smarter - (for example, it can already see open windows... it is the first part that I did).
I also placed a Zip with the project, but you may need to link a copy of the daemon jar
An explicative video: https://youtu.be/mL50K8--HbU
Anyway, beware... it can become addictive...