Key Mapping for specific apps in Mac
20 Jun 2018
Scenario: Keymapping for specific apps in Mac.
For example, Windows and Mac use control/ command keys differently, it becomes annoying when using Microsoft Remote Desktop on Mac doesn’t provide a self-contained working environment, it often jumps to other mac apps easily. Map the mac command key to control key sort out the problem.
- Download Karabiner (source code).
-
After installation, allow this 3rd party app to make system changes: System Preferences > Security & Privacy button > Allow. If not working, try close Chrome and MagicPrefs if installed. cc steps.
-
In order to map keys only for specific apps, we need the app bundle ID: Go to the application folder (e.g.
/Applications/
)mdls -name kMDItemCFBundleIdentifier -r Microsoft\ Remote\ Desktop\ Beta.app
Then got"com.microsoft.rdc.osx.beta"
-
Create a new json script under
~/.config/karabiner/assets/complex_modifications/
, Here is mysample.json
:
-
The new rule should pop in the perference/ complex modification tab:
-
Enable the new rule:
-
Debug: Karabiner has a handy tool
Karabiner-EventViewer
to track all inputs, check the eventType of the desired keys; and bundle names mentioned in the previous step. Also disable/ enable the new rules to make sure it’s applied.