Skip to content

Cocoa Key Equivalents

Ilya Kulakov edited this page Sep 10, 2019 · 2 revisions

Key Equivalents and Keyboard Layout

ShortcutRecorder uses layout-independent key codes while Cocoa uses key characters. The difference being that the same physical key does not necessarily resolves into the same character. Therefore it is recommended to always use ASCII characters for both Cocoa's key equivalents and ShortcutRecorder's shortcuts.

Use the SRKeyEquivalentTransformer and SRKeyEquivalentModifierMaskTransformer to bind an instance of SRShortcut to the corresponding Cocoa properties such as NSMenuItem's keyEquivalent and keyEquivalentModifierMask.

Clone this wiki locally