123

In Windows, one can hit Shift+F10 to access the "Context Menu." But a similar keyboard action doesn't seem possible on Mac. One potential application...

When I make a spelling error in a document, Lion gives me the option to correct the error by right-clicking (or ctrl-clicking, two-finger tapping, etc) on the misspelled word and bringing up the context menu.

enter image description here

How can I open this menu from the keyboard? And is it possible to access the Context Menu from a Mac keyboard?

samthebrand
  • 1,371
  • 14
  • 32
  • 49
emmby
  • 3,985
  • 14
  • 33
  • 39

17 Answers17

60

I always have the same question but I didn't find the answer yet.

In Windows, when we use the keyboard short-cuts we mostly use the Menu key in Windows keyboard:

The Menu Key in Windows keyboard

When this Menu key is pressed, Windows will assume that you right-clicked the highlighted/active element > then it will show you the context menu even if the mouse pointer is not pointing to the highlighted element.

So this feature seems to be missing in Mac OS. And whatever suggested solutions, even Enable Mouse Key it always require you to point/move your mouse pointer to element first, which is meaningless. If I need to use the keyboard short-cut to open the context menu on the highlighted item, why do I need again to move the mouse pointer to it also. Somehow this is not a short-cut!!

nohillside
  • 92,308
  • 39
  • 198
  • 242
Ameen Rabea
  • 708
  • 5
  • 4
41

Solution update for more recent OS versions (e.g. Monterey 12.6)

Note: it is the position of the pointer and not that of the cursor that determines where the contextual menu pops up.

Head to:

  1. System Preferences ➤ Accessibility
  2. Scroll down on the left menu to MotorPointer Control
  3. At the top choose Alternative Control Methods tab
  4. Check Enable alternative pointer actions
  5. Click on the Options... button at its right side

Enable alternative pointer actions Options

The default option for the Right Click action is fn+F12, but this can be changed by double clicking on that F12 option. Instead of keyboard shortcuts, facial expressions can also be used as an option (e.g. Stick Tongue Out) by clicking the + button.

Credit goes to user Giuseppe's comment and nohillside♦ for suggesting the edition

Original solution

The context menu can primarily be opened by a right mouse click only. But in the Universal Access settings in the System Preferences we can control mouse keys 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 trigger a right-click, but at the spot the mouse cursor is hovering, not where your text cursor is.

Go to System Preference → Universal Access → Mouse → Enable Mouse Keys (ON): Go to System Preference → Universal Access → Mouse → Enable Mouse Keys (ON)

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

CPHPython
  • 103
  • 3
CousinCocaine
  • 9,748
  • 11
  • 49
  • 73
18

For Word 365 on Mojave, Shift+F10 does the trick. If you have a Touch Bar on your MacBook Pro, you would need to press the Fn key to bring up the function keys.

ib.
  • 211
  • 1
  • 5
user307870
  • 181
  • 1
  • 2
6

ALMOST SOLVED

I got this solution to work in some Applications (like Finder, TextEdit, Firefox, ...) but not others (like Outlook, Chrome, ... )

A 'context click' can be mapped to a key/key-combo using all native Mac OS X features (thanks to its NeXT/OPENSTEP heritage). However, the solution is pretty technical "under the cover" stuff, and it may take some trial-and-error to get it to work.

Read about Key Bindings here, and follow (some) of the instructions to create your own ~/Library/KeyBindings/DefaultKeyBinding.dict file.

Key Bindings map keys (or key-combinations) to "Responders" inside the Text System. I found the Responder for rightMouseDown here, and found the "magic string" for my desired target key (F13) from this url: osxnotes.net/keybindings.html

My ~/Library/KeyBindings/DefaultKeyBinding.dict looks like this

{
    /* Context Menu */
    "^\Uf710" = "rightMouseDown:";  /* Ctrl-F13 */
    "^;" = "rightMouseDown:";       /* Ctrl-; */
}

Now I should be able to hit either Ctrl-F13 or Ctrl-; to get the context menu.

NOTE: You will have to quit & relaunch an Application to have it pick-up changes. (Worked for TextEdit in 10.10) Otherwise, log-out & log-back in.

welbo
  • 61
  • 1
  • 2
5

I use Alfred with RightClick workflow.

I mapped Option+CMD+Enter to trigger a right click in the frontmost application.

RightClick used to work only in Finder but it was improved to work in most applications.

NOTE: As of Aug 4 2021 changes they reverted back to only support Finder

jrobichaud
  • 301
  • 3
  • 5
  • 1
    Or just use the [File Actions feature](http://apple.stackexchange.com/a/254595/151730), which is built into Alfred directly rather than requiring an extra workflow install. Either way you'll need to purchase the Powerpack. – Wildcard Sep 26 '16 at 11:12
  • 1
    @Wildcard. It's different than file action feature. RightClick is a global shortcut that triggers a rightclick in the current application through applescript. File action feature requires you to open the search bar, search for a file then choose a file action. – jrobichaud Sep 26 '16 at 12:01
  • 1
    Has some delay before menu appears, but it's the best solution I've found! Works also in Forklift. – Pavel Alexeev Nov 12 '17 at 14:55
  • Looks like it only works for Finder. I tried debugged it while on another app (Chrome) and got this error in the debug log: `execution error: Finder is not the frontmost app (-2700)` – burtyish Mar 10 '22 at 14:23
  • @burtyish they seemed to have reverted the fix allowing to work with any app in this commit: https://github.com/vitorgalvao/alfred-workflows/commit/9cfa0bc4ca0ef55e2d0a06a0bf2f66c3c1c91d53 – jrobichaud Mar 10 '22 at 15:16
5

Close to what you've asked, is to enable spelling auto-correction via:

and then stay with your cursor at the end of a mispelled word, so you'll get an iOS style correction-suggestion:

then with down-arrow and left/right-arrows you can choose the correct word.

nuc
  • 4,814
  • 3
  • 26
  • 38
  • 1
    The question is not about spelling corrections. Its about accessing the context menu, spelling was just an example he gave of when it would be handy. Its also handy in thousands of other situations tho. – Brad Aug 06 '22 at 07:30
4

Try press [fn]+[SHIFT]+[F10]

To me it seems that most windows on mac F-keys can be called this way.

Cheers!

swizkon
  • 59
  • 1
4

You can use Better Touch tool to set up any tap/swipe/click/key combination to the right click.

Ali
  • 1,159
  • 1
  • 13
  • 20
  • 9
    But it will just perform a secondary click at the current coordinates of the cursor, not show the context menu for a selection made with the keyboard. – Lri Dec 01 '11 at 22:29
  • You are right, there are options to call a url or script with the selected text, and I bet you can convince the developer to add this feature as well. – Ali Dec 02 '11 at 01:06
  • I have (and looooooove) Better Touch Tool, and the developer is a freakin' magician. But for this particular use case, I [use Alfred](http://apple.stackexchange.com/a/254595/151730), which is my only other indispensable Mac application, right after BTT. – Wildcard Sep 26 '16 at 11:10
  • I opted to use Better Touch Tool for this and wanted to share my workaround: I set up a keyboard shortcut and used the "Show Menubar in Context Menu" trigger. It's not exactly what I wanted but 1) It doesn't rely on mouse position/ acts on selected items 2) I figured I might get more functionality out of this configuration since it just shows all the options of the entire menubar. – sdconrox Jan 10 '22 at 10:04
4

If you have "correct spelling automatically" checked and it doesn't seem to be working, it might be because you're trying it in an unsupported application. E.g., I can use the feature in TextEdit and Pages but not, e.g., FireFox or SublimeText 2 (two of my most used apps).

Tho I've spent way too much time looking, I haven't found any way of getting the suggested spellings from the context menu with the keys alone. The best option I've found so far is to use my thumb on the track pad to position the mouse and then hold ctl and tap (again with the thumb). It takes a bit longer because of the need for positioning, but at least I can keep my fingers on the home row.

I find it awkward to reach the ctl button, so I've used KeyRemap4MacBook (which is generally awesome and free) to customize the layout to make caps lock be ctl. KeyRemap will also let you assign ctl + click to button combinations, so you don't have to tap/click.

Shon
  • 151
  • 5
  • 1
    Question is not about spelling. The spelling correction was just an example use case. – Brad Aug 06 '22 at 07:31
3

Cmd+Shift+: Opens “Spelling & Grammar” on Chrome for me with El Capitan. It’s a clunky bodge but I can now spell check.

ib.
  • 211
  • 1
  • 5
  • Well done @ib. Getting the + between key caps instead of a hyphen is chef’s kiss awesome. – bmike Nov 14 '20 at 22:23
2

I feel your pain.....Best work around I've found is on cnet. Haven't tried it yet but I plan to. Unlike a true contextual menu, this does require you look to the top-left for the commands you seek, but may still suffice to bring you the functionality you are looking for. http://www.cnet.com/news/access-menus-via-the-keyboard-in-os-x/

user88732
  • 21
  • 1
  • 4
    Please don't just post links to articles elsewhere on the internet. This does not constitute a good answer. Please review the answer guidelines here: http://apple.stackexchange.com//help/how-to-answer – conorgriffin Aug 25 '14 at 15:33
2

To bring up the spell check use cmd + :.

heldeen
  • 131
  • 2
2

For spellchek(and more) I'm use popClip + alfred workflow Ppay

Bimawa
  • 156
  • 5
2

On my setup (external PC-style keyboard, Karabiner Elements, and single application I care about), I remapped a PC Menu key (Karabiner sees it as "application") to Keypad Numlock.

The application (CLion) has hotkey remapping ability and supports context menu for focused controls, so I mapped the key in the application.

Victor Sergienko
  • 472
  • 1
  • 4
  • 19
1

Here is my solution on Github. This is a little AppleScript that I wrote making a control-click that you can assign to key of your choice using a shortcut utility app of your choice.

1

You could use Hammerspoon to achieve this.

  1. You need to install http://www.hammerspoon.org according to instructions on their site. This is a great utility for automating your mac.
  2. Add this script to hammerspoon config (which is located at ~/.hammerspoon/init.lua).

hs.hotkey.bind({"shift"}, "F10", function() local point = hs.mouse.getAbsolutePosition() local clickState = hs.eventtap.event.properties.mouseEventClickState
hs.eventtap.event.newMouseEvent(hs.eventtap.event.types["rightMouseDown"], point):setProperty(clickState, 1):post()
hs.eventtap.event.newMouseEvent(hs.eventtap.event.types["rightMouseUp"], point):setProperty(clickState, 1):post() end)

  1. Reload the config in hammerspoon menu: File -> Reload config.

If you press shift + F10 you'll get a right click, just to be Windows congruent, but you can change the keybinding to anything you'd like. Just make sure you keep any modifiers: cmd, shift, ctrl, alt in the squiggly brackets {}

Say you wanted it to be control + alt + spacebar, then the binding would look like this:

hs.hotkey.bind({"ctrl", "alt"}, "space", ..

  • Nice, but won't this use the current mouse position, rather than the current text cursor position to trigger the action? I believe the latter is what truly matters for this question. – Giuseppe Jan 23 '21 at 09:50
  • @Giuseppe you're totally right ! i wasn't thinking clearly – Kelly Elliotson Jan 25 '21 at 08:38
  • is there any solution to use the current cursor position? i don't like to touch my mouse and navigate with cursor keys - and like to trigger a right click on the current cursor position – muescha Mar 29 '22 at 23:52
0

shift+F10 can be used in many Microsoft apps.

also, if you are using remote desktop of Windows on Virtual Machine this shortcut is very handy.

Ali Jamal
  • 101
  • 1