新的M系列將位於F4按鍵從Launchpad設定成Spotlight,網路上一般的改法是將Lauchpad改成用F4啟動,修改方式如下:
- 左上角點選 > Preferences > System settings...
- 左側欄找到 Keyboard > Keyboard Shortcuts...
- 左側欄找到 Launchpad & Dock
- 將 Show Launchpad打勾後,點選none後改成F4
這樣在開啟Launchpad的時候,按住fn (Globe)並同時按F4即可啟動。不過這樣要單手按出Launchpad還是很麻煩,下面則是改成按Spotlight那個按鍵(在F4上面那個)後,直接就啟動Launchpad:
- 新增或修改 ~/Library/LaunchAgents/com.local.KeyRemapping.plist
- 改成下面的內容後,登出再登入、或重開機就完成設定
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.local.KeyRemapping</string> <key>ProgramArguments</key> <array> <string>/usr/bin/hidutil</string> <string>property</string> <string>--set</string> <string>{"UserKeyMapping":[ { "HIDKeyboardModifierMappingSrc": 0xC00000221, "HIDKeyboardModifierMappingDst": 0x0C000002A2 } ]}</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
以上是將Spotlight按鍵改成啟動Launchpad的方法。不想要重開機的話,則有下面幾個指令可以使用:
- 印出目前狀態的指令:hidutil property --get "UserKeyMapping"
- 載入設定檔案的指令如下:
launchctl load -w ~/Library/LaunchAgents/com.local.KeyRemapping.plist - 關掉目前設定的指令如下:
launchctl unload ~/Library/LaunchAgents/com.local.KeyRemapping.plist
要完整的移除這個設定則是依序執行:
- launchctl unload ~/Library/LaunchAgents/com.local.KeyRemapping.plist
- rm ~/Library/LaunchAgents/com.local.KeyRemapping.plist
看起來要re-map蘋果的function keys (就是鍵盤最上面那一列特殊功能的按鍵),解決方案是要用到hidutil這個指令,而把相關指令放到LaunchAgents,讓登入的時候可以執行。移除以後只要在觸控板上收縮三指與大拇指(pinch with thumb and three fingers)就可以啟動Launchpad了。
參考資料
- How to remap the F4 key to Launchpad from Spotlight automatically on start:按照這個說明,在M2的Macbook Pro上設定成功
- Apple M1 MacBook Do Not Disturb Key remapping
- Remapping Keys in macOS 10.12 Sierra:這是蘋果的Techinical Note TN2450,說明如何使用hidutil指令做remapping。
- M1 MacBook Air F5 & F6 KeyRemap:有launchpad的hex code
- HID Usage Table for USB:Apr. 5, 2021的版本,去找15 Consumer Page (0x0C)那個章節
- macOS function key remapping with hidutil:解釋HID key code最清楚的文件
- Re-mapping physical function keys on MacBook Pros:解釋每個function key都會對應到兩個HID key codes,利用LaunchAgent讓hidutil生效。
- Script to re-map MacBook Pro function keys:上面那個方法搞個script來設定
_EOF_
Beautiful render of a winter landscape, unreal engine, first light, majestic mountains, frozen lake, snow, dramatic clouds, encampment, soft light, by greg rutkowski, cgsociety
Steps: 20, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 2364721562, Size: 512x256, Model hash: 6ce0161689, Model: v1-5-pruned-emaonly, Version: v1.6.0-2-g4afaaf8a
Time taken: 4 min. 28.2 sec.
A: 3.36 GB, R: 3.68 GB, Sys: 2.0/2 GB (100.0%)
沒有留言:
張貼留言