25

Is it possible to access the right click/context menu of the currently selected item (not the item under the mouse) by way of using a keyboard shortcut?

If not, is there any way to achieve this, either by Applescript or utility?

8

There is no way in general on the Mac to determine the screen coordinates of the current insertion point. So there is no way to automate a click at the current insertion point.

In some apps, there might be a way to get the coordinates via AppleScript, or it might be possible to get them using some sort of private API or other system hackery, but there is no general solution to this problem that is supported by Apple APIs.

It is, apparently, quite a common UI gesture on Windows, but it is not something you can do on the Mac.

19

The context menu can primarily be opened by a right mouse click (or a control click) only.

However, if you want to right click on a specific area on the screen without using the mouse, you may use Mouse Keys from Universal Access settings in System Preferences. With it, you can control the mouse by using the keyboard number pad. When activated, a right mouse click then can be achieved by Ctrl+5 on a keyboard with a numpad or Fn+Ctrl+i on a laptop. This will allow you to 'right-click' your word.

Go to System Preferences --> Universal Access --> Mouse --> Enable Mouse Keys (ON) Go to System Preferences --> Universal Access --> Mouse --> Enable Mouse Keys (ON)

Found on: https://stackoverflow.com/a/11238186/1919382

3

I was also looking for this kind of feature and found a good alternative.

Most context menu items in OS X can also be found in the top menu bar, and you can access this with a keyboard shortcut. By default it's set to ctrl+F2, however this often doesn't work. You can change the binding on the Keyboard preference pane.

This this post has more details http://reviews.cnet.com/8301-13727_7-57591609-263/access-menus-via-the-keyboard-in-os-x/

  • Nice answer. I have been using this workaround for quite a while as well. Unfortunately there are still plenty of actions that are only in the context menu.. – Vic Jang Mar 23 '15 at 8:20
2

One could probably write an Applescript that moved the mouse over the selected item and do a right-click. Other than that, no, I don't believe there is a way.

1

For files in the Finder, you can reach an "Actions" menu (not the built-in context menu) with Alfred's File Actions feature.

This is only in the paid version of the application, but I have it because of this and other functionality that really makes it worth it. For instance, one of the actions you can choose is "Email to..." and then start typing and choose a name read directly from your Contacts, press enter, and the "compose email" window is opened up with the recipient and subject filled in and the file attached.

With these and other features, it's not the same as the context menu, but I've never needed to access a file's context menu since I installed Alfred, so I think it accomplishes the purpose of this question, at least for the Finder.

1

The latest version of BetterTouchTool has an action you can trigger: "Open Current Finder Selection with Specific App," and another one: "Open Active/Selected Folder with Specific App."

This handles all my use cases for right clicks in Finder, personally. I use ⌥' to open the active/selected folder in the Terminal, and a gesture (two finger swipe up from bottom of trackpad) to open the current Finder selection in Adobe Bridge. Works perfectly.

  • BTT can also be used to assign a keyboard shortcut to open the context menu, which is effectively what the OP was asking for (although your solution is probably what he's looking for). – Winterflags Oct 8 '16 at 15:19
  • 1
    @Winterflags, I don't think it can just open the context menu—I don't see that option—but it can be set to activate any item in the context menu directly, either by name, or by position, or by one of multiple alternate names (e.g. Hide or Show). – Wildcard Oct 8 '16 at 16:08
  • Ah, I know it can open the context menu with trackpad gestures but maybe it cant do it with keyboard shorcuts. – Winterflags Oct 8 '16 at 16:10
1

It's far from appealing, and there really is no concrete way of doing this, but if your left with no other options this can work quite well (in macros that is).

Hold Cmd+F5 (turns voiceover on)
Press Tab
Press Space
Press Esc
Press Cmd+Ctrl+Alt+Space
Select menu item "Show menu"
Hold Cmd+F5 (turns voiceover off)

It's a really really messy system, and it doesn't work consistently. But sometimes it is the only option which works well enough to be useful...

-1

I was actually looking for this shortcut to do quick grammar checking on a selected word in gmail. Usually, painted the word (option+shift+left arrow) and then right click to see the options (and I hate using mouse).

For this particular case, there's Chrome shortcut, which is [cmd + shift ; — or — cmd :] to display grammar check. Then you can cycle through suggestions using arrow keys.

That did the work for me for that specific issue.

Hope it helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .