將普通的PC鍵盤失暂、機(jī)械鍵盤等,映射成為 Mac鍵盤布局
Automator > Service > Launch Application > no input > Keyboard > Shortcuts >Services
一钢属、下載軟件
Karabiner:鍵盤映射 [https://karabiner-elements.pqrs.org/]
二、蘋果鍵位參考
三、常用設(shè)置
- 對調(diào) Command 與 Option
在"Change Command_L Key (Left Command)"下面選擇"Command_L to Option_L"
在"Change Command_L Key (Left Command)"下面選擇"Command_L to Option_L"
PrintScreen 設(shè)為 Eject
NumLock 設(shè)為 Command+Delete 一鍵刪除文件(mac上NumLock沒用选酗,DAS鍵盤對應(yīng)的就是Clear鍵)
Insert 設(shè)為 FN
FN鍵盤
? f1-f3 控制亮度
? f2 mission control
? f4 launchpad
? f5-f6 鍵盤背光
? f7-f9 媒體控制
? f10-f12 音量控制
四蒿柳、保存自己的配置
-
找到配置文件饶套,點
Open private.xml
-
找到并修改鍵盤對應(yīng)的vendor id和product id
-
在EventViewer里面點Main標(biāo)簽,按下A鍵垒探,misc一欄里就可查看要修改鍵位代碼妓蛮。
要實現(xiàn)A和B兩個鍵互換,語法是
<autogen> __KeyToKey__ KeyCode::A, KeyCode::B </autogen>
<autogen> __KeyToKey__ KeyCode::B, KeyCode::A </autogen>
- 設(shè)置為組合鍵
<autogen> __KeyToKey__ KeyCode::A, ModifierFlag::MOD, KeyCode::B, ModifierFlag::MOD</autogen>
五圾叼、載入文件
- 點
Reload XML
蛤克,選中自定義配置就OK了。
六夷蚊、為F1构挤、F2、……F9 設(shè)置快捷鍵
- 添加任意應(yīng)用快捷鍵
- 將F1 映射為 Shift+Command+F1 即可一鍵啟動惕鼓,如:
<autogen>__KeyToKey__ KeyCode::F7, KeyCode::D, ModifierFlag::COMMAND_L, ModifierFlag::OPTION_L</autogen>
- 也可啟動任意需要功能儿倒,比如一鍵退出所有程序,設(shè)為服務(wù)添加快捷鍵,如上:
請參考 [http://wenku.baidu.com/view/b4bbd0188e9951e79a892732.html]
七夫否、其他
特殊情況下彻犁,設(shè)置鍵盤快捷鍵會出現(xiàn)問題,運(yùn)行以下命令可修復(fù):
rm ~/Library/Preferences/com.apple.symbolichotkeys.plist
- 根據(jù)自己鍵盤設(shè)置的:private.xml
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>Logitech</vendorname>
<vendorid>0x046d</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>USB Receiver</productname>
<productid>0xc52b</productid>
</deviceproductdef>
<item>
<name>Logictech</name>
<identifier>private.deviceproductdef</identifier>
<device_only>DeviceVendor::Logitech, DeviceProduct::USB Receiver</device_only>
<identifier>private.remap.pc_to_mac</identifier>
<autogen>__KeyToKey__ KeyCode::HELP, KeyCode::FN</autogen>
<!-- <autogen>__KeyToKey__ KeyCode::PC_APPLICATION, KeyCode::FN</autogen> -->
<autogen>__KeyToKey__ KeyCode::COMMAND_L, KeyCode::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::COMMAND_R, KeyCode::OPTION_R</autogen>
<autogen>__KeyToKey__ KeyCode::OPTION_L, KeyCode::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::COMMAND_R</autogen>
<autogen>__KeyToKey__ KeyCode::F1, KeyCode::F11</autogen>
<autogen>__KeyToKey__ KeyCode::F2, KeyCode::F2, ModifierFlag::SHIFT_L, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::F4, KeyCode::F4, ModifierFlag::SHIFT_L, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::F5, KeyCode::EXPOSE_ALL</autogen>
<autogen>__KeyToKey__ KeyCode::F6, KeyCode::F6, ModifierFlag::SHIFT_L, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::F7, KeyCode::D, ModifierFlag::COMMAND_L, ModifierFlag::OPTION_L</autogen>
<!-- <autogen>__KeyToKey__ KeyCode::F8, ConsumerKeyCode::MUSIC_PLAY</autogen> -->
<autogen>__KeyToKey__ KeyCode::F9, ConsumerKeyCode::EJECT, ModifierFlag::CONTROL_L, ModifierFlag::SHIFT_L</autogen>
<autogen>__KeyToKey__ KeyCode::F10, ConsumerKeyCode::POWER, ModifierFlag::COMMAND_L, ModifierFlag::OPTION_L</autogen>
<autogen>__KeyToKey__ KeyCode::F11, ConsumerKeyCode::EJECT, ModifierFlag::COMMAND_L, ModifierFlag::OPTION_L</autogen>
<!-- <autogen>__KeyToKey__ KeyCode::F12, ConsumerKeyCode::VOLUME_UP</autogen> -->
<autogen>__KeyToKey__ KeyCode::KEYPAD_CLEAR, KeyCode::DELETE, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::PC_PRINTSCREEN, ConsumerKeyCode::EJECT</autogen>
</item>
</root>
本文參考:
- [鍵盤] 還在糾結(jié)Mac版鍵盤凰慈?試試KeyRemap4MacBook吧汞幢![http://www.chiphell.com/thread-678136-1-1.html]
- 任意PC鍵盤映射到MAC鍵盤的karabiner配置xml文件[http://lonestone.iteye.com/blog/215∏7692]
- 官方文檔:[https://pqrs.org/osx/karabiner/document.html.en]