29

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?

2

9 Answers 9

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.

5
  • 2
    Is this still the case?
    – Halil Sen
    Commented Apr 11, 2023 at 9:26
  • @HalilSen Sadly, yes, it remains unchanged. Commented Apr 12, 2023 at 15:20
  • 1
    Now it's possible with <kbd>Ctrl⌃</kbd> <kbd>Return⏎</kbd> Commented Oct 17 at 18:34
  • @massisenergy it appears this is very sporadically supported currently - it works in TextEdit, but I couldn't find much else that supported it. Hopefully support will improve. Commented Oct 22 at 8:33
  • @PeterNLewis it works for me fine everywhere, including Apple and 3rd party apps. I'm using 15.1 beta BTW. Also, make sure you're selecting the right place/context with cursor before pressing the <kbd>Ctrl⌃</kbd> <kbd>Return⏎</kbd> combo. I added it as an answer below. Commented Oct 23 at 4:09
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/

1
  • 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
    Commented Mar 23, 2015 at 8:20
2

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

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

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.

3
  • 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).
    – P A N
    Commented Oct 8, 2016 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
    Commented Oct 8, 2016 at 16:08
  • Ah, I know it can open the context menu with trackpad gestures but maybe it cant do it with keyboard shorcuts.
    – P A N
    Commented Oct 8, 2016 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

In MacOS Sequoia 15.1, this shortcut Ctrl⌃ Return⏎ is introduced, which works on system apps including – Notes, Reminders, Keynote, Safari and Pages.

The behavior/type of the context menu changes, depending on the context, as it should. For example, try this shortcut in this page with and without selecting a word.

1
  • Unfortunately, this is only a partial solution. For example, in TextEdit pressing ^⏎ on a misspelled word opens a context menu without the suggestion for the correct spelling, whereas right clicking provides the full context menu. Commented 2 days ago
-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 .