For operations with existing keyboard support, whether via a single keypress or a sequence thereof, there’d just be the exercise of configuring the macropad, though yes for something with no keyboard support whatsoever Thomas would first need to add at least some key for the function. If he wanted to keep certain keys free for future assignment, he could potentially choose a weird one that people wouldn’t normally (or perhaps couldn’t) press on a traditional keyboard.
To be clear: I’m only minimally familiar with these things and do not own one. They came to mind solely because for a while there I was often bumping into mention and discussion of them in a music-production-related discord where people were setting them up for various uses. I do think I might be able to share a link as a jumping-off point, though. It should give you an idea of the kinds of software customization available (over USB, from within an application available for multiple platforms) and some of the actual hardware options too. [Addendum: Hmm, that supported hardware list is pretty dense and doesn’t link out. There do seem to be lots of search hits on Etsy as well as a good number in search engines, however.]
https://caniusevia.com/
And here’s a video from 256klabs showing a bit of configuration (using the above-linked tool) of the macropad example I shared above:
https://youtu.be/vyfjawPZ8_Y
Note that, while the resulting behaviour is a lot like software macro functionality for a traditional keyboard attached to a computer, complete with combo sequences, chording/layers, etc., instead of macro software which runs all the time on a computer, the configuration tool sends the configuration to the macropad (or other style of programmable keyboard) which then can be plugged into whatever.