Development/개발환경
Karabiner로 input source 변경하기
BongChun
2022. 4. 18. 08:19
Karabiner로 input source 변경하기
맥북에서 언어전환을 바로바로 하길 원해서 키를 맵핑하여 사용하려고 한다.
Goal
- 키맵핑을 통해 일본어 추가
Solution
input source 적용법
- 카라비너에서는 input source에 따라 키를 맵핑할 수 있다.
to.select_input_source
select_input_source change the current input source. Caution Switching to input sources which have input_mode_id (Chinese, Japanese, Korean, Vietnamese) may be failed due to an macOS issue. For CJKV input sources, sending the input source switch shortcut (
karabiner-elements.pqrs.org
- 위 페이지에서 적용하는 법을 명시하고 있다.
- 나는 일본어를 추가하길 원하므로
input_source_id
를com.apple.inputmethod.Japanese
로 설정해주기로 했다.
karabiner.json에 명시
- 예제를 확인했다면 적용해야 한다.
~/.config/karabiner
에 존재하는karabiner.json
파일을 실행하여 다음과 같이 적용한다.
{
"from": {
"key_code": "f2",
"modifiers": {
"mandatory": ["right_shift", "right_command", "right_control", "right_option"],
"optional": ["any"]
}
},
"to": [
{
"select_input_source": {
"input_source_id": "com.apple.inputmethod.Japanese"
}
}
],
"type": "basic"
}
- 맵핑하려는 키는 자신의 취향대로 설정하면 된다.
- 위의 경우 mandatory에 해당하는
modifier keys
와 함께f2
를 누른다면 일본어로 변경한다라는 의미이다. - 카라비너의 Key name은 아래의 링크를 참고한다.
https://github.com/JoshuaManuel/Karabiner-Elements-Key-List
GitHub - JoshuaManuel/Karabiner-Elements-Key-List: A reference list of keys recognized by Karabiner Elements
A reference list of keys recognized by Karabiner Elements - GitHub - JoshuaManuel/Karabiner-Elements-Key-List: A reference list of keys recognized by Karabiner Elements
github.com
작성이 끝났다면 저장을 하면 완료이다.