This question already has an answer here:
I've been looking into tools like Karabiner, which are cool, but I would like more control. In general, I'd like to remap specific keys to run AppleScript or some other code.
Ideally it wouldn't send the keystroke though to the active application.
Is there any way to do this?
At the moment I'd like to remap the numpad keys to focusing specific applications, and if possible, specific windows in those applications. A general way to run code would be best, but anything that can accomplish this would be very much appreciated.