Created
March 3, 2026 01:05
-
-
Save search5/fecb3c5a0bec6049e76b15d92d8d34da to your computer and use it in GitHub Desktop.
macos shift+space 한영 전환
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import plistlib | |
| import argparse | |
| # 1. argparse로 파일 경로 인자 설정 | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("filename", help="수정할 plist 파일 경로") | |
| args = parser.parse_args() | |
| # 2. 입력받은 filename으로 파일 로드 | |
| hotkey_plist = plistlib.load(open(args.filename, 'rb')) | |
| hotkey_60 = hotkey_plist['AppleSymbolicHotKeys']['60'] | |
| hotkey_61 = hotkey_plist['AppleSymbolicHotKeys']['61'] | |
| def shift_space(hotkey): | |
| hotkey['value']['parameters'][2] = 131072 | |
| for hotkey in (hotkey_60, hotkey_61): | |
| shift_space(hotkey) | |
| # 3. 입력받은 filename에 그대로 덮어쓰기 (fmt는 바이너리로 유지) | |
| plistlib.dump(hotkey_plist, open(args.filename, 'wb'), fmt=plistlib.FMT_BINARY) |
Author
cp ~/Library/Preferences/com.apple.symbolichotkeys.plist.bak ~/Library/Preferences/com.apple.symbolichotkeys.plist + hidutil property --set '{"UserKeyMapping":[]}'
13 -hotkey_60['value']['parameters'][2] = 131072
14 -hotkey_61['value']['parameters'][2] = 1572864
13 +# F18: ASCII=65535(없음), keycode=79, modifier=0
14 +for hotkey in (hotkey_60, hotkey_61):
15 + hotkey['value']['parameters'] = [65535, 79, 0]
~/Library/LaunchAgents/com.local.KeyRemapping.plist remove
launchctl unload ~/Library/LaunchAgents/com.local.KeyRemapping.plist
rm ~/Library/LaunchAgents/com.local.KeyRemapping.plist
hidutil property --set '{"UserKeyMapping":[]}'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
python3 macos_hangul_input.py ~/Library/Preferences/com.apple.symbolichotkeys.plist