python helper script to convert hangul keyboard mapping for any keyboard.
When I switched my keyboard layout from QWERT to Colemak-DH (the physical layout), it became a disaster to type Korean on my Mac and Linux systems. Because, IMEs designed to use English letters to convert to Korean letters so that Korean layout has been modified along with Colemak modification. After research, I found libhangul uses mapping xml for Korean Input, which allows me to modify its mapping xml for any physical keyboard layout.
On Mac, 구름 입력기 uses libhangul, so the same approach can be applied.
- Input Method with libhangul
- python3
- update config.yaml as needed
name: colemak-dh:crkbd:thunderbird2086 conversions: - targets: - hangul-keyboard-2.xml - hangul-keyboard-2-full.xml mapping: e: f r: p t: b s: r d: s
nameis a reference and inserted into xml mapping<?xml version='1.0' encoding='utf-8'?> <hangul-keyboard id="2" type="jamo" converted="colemak-dh:crkbd:thunderbird2086">
targetshas mappig file names to be modified. In case 구름 입력기 is installed on a Mac, it can be found under/Library/Input Methods/Gureum.app/Contents/Frameworks/Hangul.framework/Versions/A/Resources/keyboards.
mappigcontains key mapping. For instance,e: fchanges keyetof. Refer to the image below. - run
convert.py, which requires input path at least.$ python3 convert.py --help usage: Keyboard mapping convertor for libhangul [-h] [--config CONFIG] --in_path IN_PATH [--out_path OUT_PATH] optional arguments: -h, --help show this help message and exit --config CONFIG, -c CONFIG mapping confiiguration --in_path IN_PATH, -i IN_PATH path for input files --out_path OUT_PATH, -o OUT_PATH path for output files. Default is current directory.
- copy the output file to the input directory.
- enjoy
- sample keyboard layout: custom Colemak-DH layout
