How to map a pedal and program keyboard maestro such that the pedal can have different presses per app?

Sorry for the cumbersome title...what I want to do is simple enough, there may be tutorials already I just didn't have much success searching for them.

I bought a foot pedal. My goal is to have it so that I can have per-app shortcuts, based on the active app. I'd also like to be able to have a shortcut which will force the foot pedal into some fixed configuration, if possible (so essentially a per-app mode, but with an override).

The foot pedal is reprogrammable, but it's cumbersome to do every time I switch an app. Ideally I could map the 3 buttons to some unused key combination, then use keyboard maestro to program how those key combinations work.

First, what key combination space is convenient for this sort of thing?

Second, any tips on how to program keyboard maestro to do the above? I do know how to program, but I don't really know the world of keyboards at all. For example, I would be fine having multiple shortcuts that call a script that then manages the state...but that would still involve knowing how to get keyboard maestro to pass along the keystrong and current app information etc, and there may be a cleaner way to do what I want from within keyboard maestro itself.

I appreciate any help you have to give!

Edit: I should mention I'm on a mac, though I also use parallels to use windows and would like the setup to work in both if possible? I'm actually not sure what the interaction between keyboard maestro and parallels is. Do they work fine together? Do I need to get a separate app to run/configure inside of the windows running in parallels?

Also, I also have karabiner elements which sort of overlaps in functionality with keyboard maestro I guess. In my experience keyboard maestro was much easier to do basic macros, but for more advanced stuff no clue.