Define / override keyboard shortcuts (OS X)?
Hello!
So I've been trying to work up a patch that sends x/y deltas from the internal trackpad of my MacBook Pro to osc addresses based on which alphanumeric keys are currently held down on the built-in keyboard (for now we're assuming only one key at a time).
The patch should also allow the user to use either of two modifier keys (ideally shift and cmd) along with the alphanumeric keys to restrict output to x deltas or y deltas. Shift + key works fine, however, Max interprets cmd+key, ctrl+key, and alt/option+key as application shortcuts, so instead of trackpad deltas, one gets beeps, makes new windows, quits the application, etc.
My question is whether there's any way to define, remap, or override application-level keyboard shortcuts in Max 7.3.4 / OS X 10.12.6 in order to allow the creation of "cmd+key" shortcuts at the patch level. Searching the forum archives reveals lots of references to the shortcuts being defined in a "max-keycommands.txt" file, which seems to be outdated as I can't find it anywhere.
Since this probably isn't the clearest possible description of what I'm going for, I've included a patch which demonstrates the issue I'm having. Incidentally I'm looking to do this in the first place in order to send data to SuperCollider, where OS X HID support still leaves something to be desired, so if anyone happens to know of a bulletproof pure sclang solution (as opposed to MouseX/MouseY/KeyState/SendTrig), I wouldn't say no! JS solutions or totally outside the box non-Max suggestions are also more than welcome.
Thanks!
I'd love to be able to do this as well. In my case I'd like to map Cmd+8 and Cmd+2 to different shortcuts since those interfere with a program I use to make Cmd+<number> open apps in the dock.
btw the aforementioned max-keycommands.txt
file on Mac is located at:Applications/Max.app/Contents/Resources/C74/init/max-keycommands.txt
^ So maybe I'm in luck? Time to break things!
Oh, nice catch! Can't believe I forgot to look inside the bundle... Looks like the text file is just the definitions for the single-key shortcuts (e.g. "i" to make a new integer box) rather than the application-level stuff, so it may not provide a means of disabling, say, cmd+n, cmd+q, etc, but if you work out how to do more complex mappings using this file, this thread might be a good place for up to date information.
With regards to my actual patch, the workaround I've arrived at for now is to reserve the "x" and "y" keys to toggle x and y axis output, an approach which has also allowed me to pack the state of the shift key as part of the osc message in case I need to use it for anything in SuperCollider and also to reserve the "p" key to toggle mouse polling (though there's probably a slicker way to do this automatically when x or y output is on and a non-reserved key is depressed).
In the interest of good thread citizenship I've included a generic version of the patch in case anyone digs this thread up while trying to do something similar. Obviously it's not specific to communication with SC; you can format the data however you like and send it wherever you need to.
any solution to disabling the error sound while using (cmd+key) or (ctrl+key)?