Menu & System Preference keyboard shortcuts weirdness.
Menu & System Preference keyboard shortcuts weirdness.
- Subject: Menu & System Preference keyboard shortcuts weirdness.
- From: Keith Blount <email@hidden>
- Date: Wed, 17 Dec 2008 16:55:41 -0800 (PST)
Hello,
A user has just pointed out a very strange situation in my program concerning keyboard shortcuts that I have been unable to fathom, so I was wondering if anyone here might have seen something like it before or have an idea as to what might cause it. The strangeness is that this doesn't seem to be related to code as far as I can see (which usually means that it is related to code and I just can't see it).
While a document in my document-based app is open, if the user goes to System Preferences > Keyboard & Mouse > Keyboard Shortcuts and assigns a custom keyboard shortcut to one of the menu commands in my app, suddenly the cmd-C keyboard shortcut for Copy in the Edit menu disappears (and I hasten to add that it doesn't matter what keyboard shortcut you assign in Keyboard Preferences - assign ctrl-cmd-0 for "Delete" and cmd-C is suddenly no longer available for "Copy" - weird). If the user quits the app and restarts it, all keyboard shortcuts are restored. If no document is open while assigning keyboard shortcuts, there are no problems. But if the program is running and a document is open, assigning a keyboard shortcut via System Preferences causes certain other keyboard shortcuts - Copy for sure, possibly others I have yet to notice - to stop working. This seems very strange to me. I tried unhooking the delegate of my Edit menu. I tried commenting out all
NSMenu delegate methods, in case they were interfering somehow... I tried getting rid of menu items that might be similar to Copy (Copy Ruler, Copy Font etc), just in case... But so far I just cannot fathom a reason why arbitrary keyboard shortcuts assigned via System Preferences would interfere with established and totally different keyboard shortcuts in my running app.
Has anyone seen anything like this? If anyone can point me in the direction of where the problem might lie - I know there's not much to go on but I can't see where in code this could be caused as copy: just uses the generic copy: first responder command and my app doesn't interfere with it - I would be very grateful.
Many thanks in advance and all the best,
Keith
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden