TouchOSC > OSCulator MIDI Note > Keystroke. How to?

ismist's icon

Hi, the title line somewhat expresses what I'm trying to achieve. I'm in the midst of creating a TouchOSC template for the iPad that facilitates editing/production by giving access to all of the keyboard shortcuts for Ableton in one page.

Now, I've been able to use OSCulator to map out most of the key combos (like Cmd + C and so on), but I'm running into considerable trouble building the following functionality:

Press and hold down button A in TouchOSC > M4L > Hold down Cmd key until button A is released.

In other words, I want to be able to hold down the Cmd, Shift, Ctrl, or Option keys for as long as I'm holding the button on TouchOSC. This would allow me to only use the mouse and TouchOSC to do any editing in the program, without the keyboard. Then you could, for instance, hold down Cmd (the T-OSC version) and drag down on a midi note in a midi clip in Live to modify its velocity.

- OSCulator is unable to do this kind of functionality.
- Haven't been able to do it with midiStroke either.
- I don't really have the money to buy Bome's, so

I'm trying to do it in M4L. I'm a complete novice at Max, though, so I have no idea what I'm doing here. I've tried to patch up something based on other people's work, but it's not working. Here's what I've got so far:

{
    "boxes" : [         {
            "box" :             {
                "maxclass" : "message",
                "text" : "keydown 56",
                "presentation_linecount" : 2,
                "patching_rect" : [ 220.0, 114.0, 67.0, 16.0 ],
                "fontsize" : 10.0,
                "presentation" : 1,
                "numinlets" : 2,
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "id" : "obj-10",
                "fontname" : "Arial Bold",
                "presentation_rect" : [ 220.0, 114.0, 47.0, 27.0 ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "varname" : "mouse_controller",
                "text" : "aka.keyboard",
                "color" : [ 1.0, 0.360784, 0.682353, 1.0 ],
                "patching_rect" : [ 178.0, 146.0, 69.0, 17.0 ],
                "fontsize" : 9.0,
                "presentation" : 1,
                "numinlets" : 1,
                "numoutlets" : 0,
                "id" : "obj-37",
                "fontname" : "Arial",
                "presentation_rect" : [ 229.0, 177.0, 69.0, 17.0 ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "message",
                "text" : "keyup 56",
                "presentation_linecount" : 2,
                "patching_rect" : [ 146.0, 116.0, 53.0, 16.0 ],
                "fontsize" : 10.0,
                "presentation" : 1,
                "numinlets" : 2,
                "numoutlets" : 1,
                "outlettype" : [ "" ],
                "id" : "obj-11",
                "fontname" : "Arial Bold",
                "presentation_rect" : [ 229.0, 152.0, 47.0, 27.0 ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "select 0 127",
                "patching_rect" : [ 203.0, 79.0, 67.0, 18.0 ],
                "fontsize" : 10.0,
                "presentation" : 1,
                "numinlets" : 1,
                "numoutlets" : 3,
                "outlettype" : [ "bang", "bang", "" ],
                "id" : "obj-8",
                "fontname" : "Arial Bold",
                "presentation_rect" : [ 226.0, 109.0, 67.0, 18.0 ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "route 36",
                "patching_rect" : [ 205.0, 46.0, 49.0, 18.0 ],
                "fontsize" : 10.0,
                "presentation" : 1,
                "numinlets" : 1,
                "numoutlets" : 2,
                "outlettype" : [ "", "" ],
                "id" : "obj-5",
                "fontname" : "Arial Bold",
                "presentation_rect" : [ 228.0, 76.0, 49.0, 18.0 ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "midiselect @note all",
                "patching_rect" : [ 206.0, 14.0, 113.5, 18.0 ],
                "fontsize" : 10.0,
                "presentation" : 1,
                "numinlets" : 1,
                "numoutlets" : 8,
                "outlettype" : [ "", "", "", "int", "int", "int", "int", "int" ],
                "id" : "obj-3",
                "fontname" : "Arial Bold",
                "presentation_rect" : [ 229.0, 44.0, 113.5, 18.0 ]
            }

        }
,         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "midiin",
                "patching_rect" : [ 42.0, 12.0, 40.0, 18.0 ],
                "fontsize" : 10.0,
                "presentation" : 1,
                "numinlets" : 1,
                "numoutlets" : 1,
                "outlettype" : [ "int" ],
                "id" : "obj-1",
                "fontname" : "Arial Bold",
                "presentation_rect" : [ 78.0, 62.0, 40.0, 18.0 ]
            }

        }
],
    "lines" : [         {
            "patchline" :             {
                "source" : [ "obj-10", 0 ],
                "destination" : [ "obj-37", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-8", 1 ],
                "destination" : [ "obj-10", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-8", 0 ],
                "destination" : [ "obj-11", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-1", 0 ],
                "destination" : [ "obj-3", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-11", 0 ],
                "destination" : [ "obj-37", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-3", 0 ],
                "destination" : [ "obj-5", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
,         {
            "patchline" :             {
                "source" : [ "obj-5", 0 ],
                "destination" : [ "obj-8", 0 ],
                "hidden" : 0,
                "midpoints" : [ ]
            }

        }
]
}

Someone please help? Is what I'm trying to do even possible? Is there possibly some easier way someone's already figured out to do this? I've done my share of Googling on this, and have come up empty..