I used the DX button mod (dx+.tmh) and made a target profile, which creates joystick + keyboard and maps all joystick + throttle buttons to DX buttons. Then I added a some magic and created shift layer+tempo combinations that use the same DX buttons and adds CTL+SHF modifiers depending on the layer and short/long presses.
I tought I would be able to map buttons and the modified buttons to DCS without creating too many separate DX buttons.
In addition to the DX buttons I send keyboard keys for Track IR + Cocpit Views with long presses / shift layer.
All worked well until I added the layer + modifier combinations to all hats plus few other buttons. Now I'm getting an error when running the script and pressing a modified button: Runtime Error: Index out of bounds for: h2blookup in _key ( line 557 in target.tmh )
I know there's a 120 button limit, but I'm obviously pushing the script over some other boundary too. Am I trying to be too clever and should I just create more DX buttons and use those instead of using combinations of modifiers?
Edit: This turned out to be use error > I had input wrong constants for modifiers. I accidentally used virtual keycodes from defines.h instead of the actual modifier constants which are defined in target.tmh.