60

I'm trying to figure out why a certain keyboard combination is no longer working.

As an example, Sublime Text 2 ships with a keyboard shortcut for opening the Find/Replace panel:

Command + Option + F

This combo worked fine until I did a clean install of OSX 10.8.5, after which it mysteriously stopped working in Sublime Text.

I know keyboard sequences can be captured by processes other than the frontmost (like by the OS) so I was wondering if there is a way of checking by which process a particular keyboard command was "consumed"?

1

4 Answers 4

67

ShortcutDetective solves your problem. It's free, simple, and to the point.

8
  • 5
    Fantastic recommendation! This did the trick for me.
    – D Raymond
    Commented Apr 5, 2019 at 18:10
  • 1
    Awesome software, but doesn't seem to work for media keys/shortcuts : [
    – CTS_AE
    Commented May 2, 2020 at 2:16
  • 4
    After migrating my Intel MacBook Pro to a new Apple Silicon (M1 Max) Macbook Pro, ShortcutDetective sometimes crashes for me. Is anyone else experiencing this problem? (I used it so often that I would keep it running on my side monitor, but because of this, not anymore. It's still useful for one-off problems, like the OP's question.) Commented Dec 20, 2021 at 0:32
  • 5
    Yep, I also got a crash on my M1 MacBook Air, but it worked long enough to tell me which app was stealing the keyboard shortcut I was trying to use (it was Logitech Options, and updating it fixed the problem). Commented Dec 27, 2021 at 2:41
  • 6
    It hasn't been updated in years. It crashes every time a shortcut is trigger that's handled by the system (e.g. Shortcuts defined in System Preferences)
    – huyz
    Commented Nov 9, 2022 at 20:22
25

I don't know any fast and efficient method to find the recipient of a shortcut. But here is a receipe to initiate the hunt:

  1. Close most of your running applications so as to improve the efficiency of the hunt.

  2. Open a Terminal window, and run the following command:

    /usr/bin/sudo opensnoop | more
    

This command will track down every open system call.

  1. Switch to the context where your shortcut is intercepted by an unknown application and type ⌘ cmd+⌥ option+F.

Look for a culprit hint from the file names opened.

  1. while unsuccessfull, add one application, and GOTO 3.
15
  • 1
    Nice! If you do this fast enough, you should have a pretty succinct list of processes. I had about 50 lines, half of which were a background process I knew wasn't listening to keyboard presses so I was easily able to filter those out in a text editor. The remaining 20 or so lines recorded 3 other processes, and 75% of them contained my culprit. Thanks so much for sharing, @daniel Commented Jan 3, 2018 at 17:28
  • 1
    Thanks Daniel. I'd been frustrated for ages that something else was capturing a shortcut meant for one of my applications (and even worse, playing a little ping sound!). ran this, saw maybe 4 apps making calls, one of them was opening "ping.aiff", led me straight to the culprit!
    – Biglig
    Commented Feb 26, 2019 at 10:35
  • 2
    This worked great, but in macOS 12 it seems that opensnoop isn't working because of System Integrity Protection. Commented Apr 6, 2022 at 3:21
  • 3
    sudo fs_usage -f filesys can get you there without having to mess with the System Integrity Protection
    – jgreen
    Commented Aug 7, 2023 at 21:55
  • 1
    @jgreen You should create an answer for this solution. It's infinitely simpler on newer MacOS's. Commented Oct 27, 2023 at 18:42
3

sudo fs_usage -f filesys can get you there without having to mess with the System Integrity Protection.


This was initially a comment on Find which process receives a given keyboard command and was suggested to be added as an answer. Unfortunately, it was a while ago so I don't remember how exactly this was helpful but at least some people found it useful.

1
  • This moves too fast to be useful.
    – Alper
    Commented Jan 24 at 13:48
1

KeyCue provides visual feedback on the keyboard shortcuts. It can be downloaded as a trial version.

KeyCue from Ergonis

I have it configured so that a double tap and hold on the Command key displays all the currently active shortcuts.

2
  • 3
    After trying KeyCue, it looks to me like it only shows the keyboard shortcuts associated with menu commands for the current active application. Additionally, it seems to show global hotkeys from Keybaord Maestro and maybe one or two other specific supported applications. Does it show global hotkeys for all applications for you?
    – Paul
    Commented Mar 6, 2017 at 14:32
  • I find it somewhat mysterious as to what hotkeys are shown for 'other' apps. I think it attempts (but doesn't fully succeed) to show global hotkeys that are relevant to where you are. The User Guide specifically refers to Keyboard Maestro.
    – Gilby
    Commented Mar 7, 2017 at 5:56

You must log in to answer this question.

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