Die Command + Q die

One thing that immediately annoyed me about the Mac was that the shortcut to close the application is Command + Q. This is just way too close to Command + W, the shortcut to close a tab/window. Being fast with the fingers I will tend to press Command + Q at times closing the entire program together with the documents I’m working on / tabs I’m browsing / IMs chats I’m having. Now for some applications there are work arounds, e.g. for Cocoa based applications (e.g. Safari, Mail) you can assign another shortcut to the menu item in the Keyboard Shortcuts tab in the Keyboard & Mouse preference pane

  1. Click on the “+” button
  2. Select the application (e.g. Mail.app)
  3. Type in the quit menu item text in the “Menu Title” field (e.g. for Mail.app it would be “Quit Mail”)
  4. Enter your keyboard shortcut

keyboard shorcuts change cocoa based applications quit shortcut

Now this would be nice to have for all applications but due to the fact that for each application the menu item to close the application is based on the application itself (e.g. Mail = “Quit Mail”, Safari = “Quit Safari”), it is plain to see there is no easy way to cover all applications. Also, as mentioned, it works only for Cocoa applications, so this wont work in applications like Firefox. Also some applications like NeoOffice will still respond to Command + W. So had to search for other alternatives.

For Firefox you can configure Firefox to prompt to confirm closing if there are multiple tabs open and there are probably extension that may help prevent the closing of the browser, but I wanted to find a complete solution. So after much Googling I finally found this blog post on disabling Command + Q with Quicksilver by using triggers.

In Quicksilver’s Triggers page:

  1. Add a trigger by pressing the “+ button” then selecting “Hotkey” (a new row should be created)
  2. Click the empty space under the “Command” column of the newly created row
  3. In the “Select an item” field, press . to enter text mode and clear any text that appears
  4. In the “Action” field, enter “Large Type”
  5. Leave the “Target” field blank and click save
    trigger command disable quit

  6. Now to create the keyboard shortcut by click the “None” field under the “Trigger” column
  7. A drawer will pop out and in the “Settings” Tab, press the “Edit” button in the “Hot Key” field and press Command + Q
  8. In the “Scope” Tab, ensure it is “Enabled in all applications” (any other option does not seem to work even though I specify the correct applications. possibly a bug)
  9. So now the Command + Q shortcut is disabled as long as this trigger is enabled
    disable command q trigger

So now when you press Command + Q the application no longer closes and gives you an little beep indicating no action is assigned to the shortcut. What if you still want a shortcut to close it? Just add another trigger!

  1. Add new Hotkey trigger
  2. Select an Item: Current Application
  3. Action: Quit
    trigger command quit
  4. Select your appropriate shortcut and be happy =)

So go download Quicksilver. It can do a heck of a lot more than just this with the great plugins it has: resize images, open bookmarks, move files and add. Check out the Lifehackers’ top 10 Quicksilver plugins or the tutorials and start delving into the world of Quicksilver

Advertisement

2 thoughts on “Die Command + Q die

  1. Thanks! I’ve been looking for a way to disable command-q for NX for quite some time. This is the answer I’ve been looking for.

  2. Here is a better solution:

    – System Preferences->Keyboard->Keyboard Shortcuts
    – Change the hot key for “Show Help Menu” to Command-Q

    Now when you press Command-Q in ANY application, you get help search dialogue. Think of it as Command-Question now rather than Command-Quit.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.