{"id":740,"date":"2003-12-15T17:37:32","date_gmt":"2003-12-15T22:37:32","guid":{"rendered":"\/?p=740"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"keyboard_shortcuts","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2003\/12\/15\/keyboard_shortcuts\/","title":{"rendered":"Keyboard Shortcuts"},"content":{"rendered":"<p>\n<a href=\"http:\/\/daringfireball.net\/2003\/12\/losers_weepers\">John Gruber<\/a> and <a href=\"http:\/\/www.decaffeinated.org\/archives\/2003\/12\/16\/shortcuts\">Christopher Clark<\/a> discuss keyboard shortcuts. I&rsquo;m more optimistic than Gruber in that I think Apple can come up with a good system for user-customizable keyboard shortcuts, without applications having to explicitly register them. Instead of having a preferences panel, there should be a more direct interface, like <a href=\"http:\/\/www.mjtsai.com\/blog\/2003\/04\/09\/menu_master_10.html\">Menu Master<\/a>&rsquo;s. Apple writes the menu manager, after all. Also, Joshua Dady pointed me to <tt>\/Library\/Scripts\/Mail Scripts\/Scripts Menu<\/tt>, which has instructions for adding keyboard shortcuts to menu scripts.\n<\/p>\n\n<ul>\n\t<li><a href=\"http:\/\/www.entourage.mvps.org\/help\/script.html\">Entourage<\/a>: <tt>\\csmY<\/tt><\/li>\n\n\t<li><a href=\"file:\/\/localhost\/Library\/Scripts\/Mail%20Scripts\/Scripts%20Menu\/Create%20New%20Mailing%20List%20Mailbox___ctl-m.scpt\">Mail<\/a>: <tt>___ctl-shift-cmd-Y<\/tt><\/li>\n\n\t<li><a href=\"http:\/\/www.lazerware.com\/osamenu\/OSAMenu_Docs.html\">OSA Menu<\/a>: <tt>\\CO+Y<\/tt><\/li>\n\n<\/ul>\n\n\n<p>\nI must admit that my own applications are currently guilty of not supporting Close All Windows and Minimize All Windows. I&rsquo;m working to correct that. For Cocoa developers, here is a category that will help:\n<\/p>\n\n<pre>\n@implementation NSApplication (yourPrefix)\n- (NSArray *)yourPrefixVisibleRegularWindows\n{\n    NSMutableArray *result = [NSMutableArray array];\n    <a href=\"http:\/\/www.mjtsai.com\/blog\/2003\/12\/08\/cocoa_enumeration.html\">foreach<\/a> ( window, [self orderedWindows] )\n        if ( [window isVisible] &amp;&amp; [window canBecomeMainWindow] )\n            [result addObject:window];\n    return result;\n}\n@end\n<\/pre>\n\n<p>\nDon&rsquo;t forget to implement <code>-validateMenuItem:<\/code> so that the commands are disabled when there are no windows. OmniOutliner currently supports the commands, but gets the validation wrong.\n<\/p>","protected":false},"excerpt":{"rendered":"<p>John Gruber and Christopher Clark discuss keyboard shortcuts. I&rsquo;m more optimistic than Gruber in that I think Apple can come up with a good system for user-customizable keyboard shortcuts, without applications having to explicitly register them. Instead of having a preferences panel, there should be a more direct interface, like Menu Master&rsquo;s. Apple writes the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-740","post","type-post","status-publish","format-standard","hentry","category-technology"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=740"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/740\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}