How to Right Click Using Keyboard on Mac

Macs come with a ton of great keyboard shortcuts and bindings that make it really easy to perform a lot of tasks in the system. However, if there is one major keyboard shortcut that’s missing from macOS all these years, it’s that you can’t perform a right-click on a selected item using the keyboard. This particular feature has been present on Windows keyboards since time immemorial and it sucks that MacBooks don’t have it. So, if you’re looking for a way to perform a right-click from a Mac keyboard, we’ve got you covered.

Right Click Using Keyboard on Mac

For the most part, there are ways that you can configure keyboard shortcuts to perform a right click in macOS, however these ways simply perform a right click wherever the mouse cursor happens to be, instead of the file, folder, URL, or word that you happen to have selected. So after quite some time of scouring the internet, I was able to figure out three separate ways that you can right click on a highlighted element without having to move your mouse cursor there first.

Note: I tried these methods on my 2017 MacBook Pro running macOS Mojave Developer Beta and all of them worked perfectly fine.

Using Apple Script and Automator

The first (and the only free) method to right click on Mac using a keyboard requires some Apple Script work, and a little bit of playtime with Automator — both incredibly useful tools that Apple bundles with every Mac. Here are the steps you’ll need to follow:

  • Open Automator, and create a new Service by selecting ‘Contextual Workflow.’

  • In the drop down box next to “Workflow receives” select “no input” and ensure that the next drop down box reads “any application.”

  • Use the search box in Automator to search for “run AppleScript.” Drag and drop it into the Automator workflow.

  • Paste the following AppleScript code into the workflow by replacing the comment that says “your script goes here.”

tell application "System Events" to set frontApp to name of first process whose frontmost is true
tell application "System Events"
tell application process frontApp
set _selection to value of attribute "AXFocusedUIElement"
tell _selection to perform action "AXShowMenu"
end tell
end tell

right click mac keyboard automator step 4

  • Once you’re done, save the workflow with a suitable name, I’m using “Right Clicker.”
  • Now, in System Preferences, go to Keyboard -> Shortcuts -> Services. Scroll down and find the service you just created.

  • Click on ‘Add Shortcut‘ to set a keyboard shortcut to the service. I’m using command+shift+. for this. You can use any keyboard shortcut that’s easiest for you to remember. Just ensure that it’s not a system keyboard shortcut like “command+space” or “command+control+Q.”

  • Once you’ve done that, go to System Preferences -> Security and Privacy -> Privacy -> Accessibility.

  • Here, click on the Plus icon to add a new app. Choose ‘Automator’ and add it to the list of apps that are allowed to control your computer.

    • You’ll also have to add each app where you want to use this keyboard shortcut to the list. I’ve added Finder to ensure that the shortcut works when I’m using the Finder app with my keyboard.

 

Once you’ve done all this, you’ll be able to select any file or folder in Finder, and simply press the keyboard shortcut to open the right-click menu for that file or folder.

Using Better Touch Tool

If you’re annoyed of having to add every single app you want to use the right click shortcut on to the list of apps allowed to control your Mac, you can use Better Touch Tool (45 day free trial; license starts at $6.50) as well. The app is paid, but it offers a free trial, and brings a lot of features. Here’s how you can use Better Touch Tool to right click on a selected element on Mac.

  • Launch Script Editor on your Mac, and paste the following AppleScript into it. Save the file (I saved it as rightclickscript on my Desktop).

tell application "System Events" to set frontApp to name of first process whose frontmost is true
tell application "System Events"
tell application process frontApp
set _selection to value of attribute "AXFocusedUIElement"
tell _selection to perform action "AXShowMenu"
end tell
end tell

  • Next, in Better Touch Tool preferences, head over to the Keyboard tab.

  • Click on “Add New Shortcut or Key Sequence,” select “Key Sequence” and choose the key combination you want to use.

  • Click on the box under “Trigger Predefined Action” and choose “Launch Application /Open File / Start Apple Script.”

  • From the pop-up, select the Apple Script file you just saved.

That’s it, you can now use your chosen keyboard combination to perform a right-click on your Mac.

Using Alfred

If you don’t want to handle writing and saving an Apple Script, you can use a pre-built Alfred workflow. Alfred (free trial; license starts at £19) is a productivity app for Mac, and the only paid Mac app other than BTT that I recommend people to check out. There’s a free version available, but you’ll have to buy the Alfred Powerpack to use Workflows.

  • Download the Right Click workflow.
  • Open the downloaded file and it’ll automatically be added to Alfred.
  • You’ll probably have to install an update to the workflow. To do this, just open Alfred and type “update.”
  • Once the update has been installed, head over to Alfred Preferences and go to “Workflows.”

  • Select the Right Click workflow, and set your preferred hotkey to use for right clicking.

That’s it, you’ll now be able to use the hotkey to right click on any selected element on your Mac.

SEE ALSO: 10 Best New macOS Mojave Features You Should Know

Use Your Mac Like a Pro With Keyboard Control

Using a Mac with just the keyboard is very much possible, and in many cases it’s easier to not use the trackpad (no matter how good) or a mouse to navigate your Mac. Personally, I’m more of a keyboard-leaning person myself and this shortcut is really helpful for me. So, now that you know how to right click on Mac with keyboard, go ahead and start using your Mac like a keyboard pro. If you face any problems, or if you know of another method to do this, let me know in the comments section below.



from Beebom https://ift.tt/2zhmVSb
Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

0 coment�rios:

Post a Comment