Usb device key as a "shift" to modify other keys

I tried to search but the word shift brings up results for the actual shift button. I have an x-keys xk-24 and I have a few physical buttons that trigger key presses. I would like to use another physical button as a "shift" key to hold while pressing these other buttons to trigger alternate key presses. What is the terminology I'm looking for in the software to execute what I'm trying to do? Many thanks-
Button 1 does CMD-1. Button 2 would be shift, so if I hold button 2 and press button 1 it triggers OPT-1

The term is, I believe, modifier key. I’m not sure you can achieve what you’re trying to do, but I’m no expert!

You cannot use an XK key as a modifier.

However, if you are talking about Keyboard Maestro macros triggered from the XK device then you can do this.

Create two macros:

Macro “Modifier Pressed”

  • Trigger on XK key X pressed
  • Set variable “Modifier Down” to 1

Macro “Modifier Released”

  • Trigger on XK key X released
  • Set variable “Modifier Down” to 0

In any other macro, add an If Then Else action with a Variable condition on the “Modifier Down” variable and behave in the two different ways depending on whether it is 0 or 1.