> On Oct 25, 2013, at 18:37, "Rick Mann" <rm...@latencyzero.com> wrote: > > I’m working on a complex app with lots of commands. I’m considering > eventually allowing users to customize the keyboard shortcuts they use. I > don’t want to build all that UI now, but I thought it might make sense to > build in the underpinnings now. > > What techniques do people use to implement this capability? I’ll have both > menu shortcuts, which I presume are modified by getting at the NSMenu > instances and changing them, and shortcuts for other operations that don’t > appear in the menus (some of my main views and controllers will handle > keystrokes). For those I can build my own mapping system, but I was curious > what others had done, or if there’s some nice framework out there already. > Googling didn’t turn up much.
The app at my last job was pretty complex and had a couple different modes, so two commands could share the same key equiv and never conflict. I basically kept a list of OSType commands, which mode the command was good for (e.g. object mode or text mode), and the key equiv. The equivs got installed at app init time, every time the mode switched, and after editing the equivs. It's actually a pretty simple mechanism to do. Steve via iPad _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com