During my work on the support for older OS X versions I stumbled upon a bug where a shortcut would refuse to register saying it’s already registered. This lead me to the kEventHotKeyExclusive option used for registering the Carbon hot keys.
In the exclusive mode the RegisterEventHotKey call will refuse to register a hotkey that already exists. We have to handle that case somehow, currently we just crash. But it’s a hard case to handle in the UI, because Carbon won’t tell us which app registered the hotkey before us. (What should we tell the user? Just saying that the shortcut is already used is dumb.)
@shpakovski, what do you think about dropping the exclusive mode? Then the hotkey registration won’t fail even if the shortcut is already registered. And the worst that can happen is that two apps will respond to the same shortcut, which is a case that’s pretty easy to understand and fix for a user.
During my work on the support for older OS X versions I stumbled upon a bug where a shortcut would refuse to register saying it’s already registered. This lead me to the
kEventHotKeyExclusive
option used for registering the Carbon hot keys.In the exclusive mode the
RegisterEventHotKey
call will refuse to register a hotkey that already exists. We have to handle that case somehow, currently we just crash. But it’s a hard case to handle in the UI, because Carbon won’t tell us which app registered the hotkey before us. (What should we tell the user? Just saying that the shortcut is already used is dumb.)@shpakovski, what do you think about dropping the exclusive mode? Then the hotkey registration won’t fail even if the shortcut is already registered. And the worst that can happen is that two apps will respond to the same shortcut, which is a case that’s pretty easy to understand and fix for a user.