Zend certified PHP/Magento developer

Is there way to intercept a keystroke and send a different combination of shortcuts to the active software?

I’m currently working with some editing software that requires a lot of different shortcuts to achieve what I often need.

I’ve done a bit of research and tried some tools but I wasn’t able to find a software that does as explained in the title.

Let’s say I’m using a image management tool and I want to set an image as a pick, label it as green and assign it five stars and move to the next image. Within Adobe Lightroom I would need to use the following shortcuts

  • P
  • 5
  • 8
  • Right

I would like to know how to create a macro or shortcut that with Adobe Lightroom open would allow me to just press 5 and the software gives Adobe Lightroom the needed shortcuts in the correct order.

I have other use cases, but this is one of the most common ones. I’ve tried some macro softwares but they don’t act like a middleman like that. They require me to record an action (which is fine), but then I have to go to the macro software and run that action. That doesn’t work for me, as I just want to quickly run trough a series of keystrokes.

Also I want to send this series of keystrokes according to the software that happens to be active. To Adobe Lightroom it might be one combination, to Adobe Premiere Pro it might me another, and to Photo Mecanic yet another combination.

Is there a (maybe easy) way to achieve that?