LoginSignup
12
12

More than 5 years have passed since last update.

El Capitan の日本語入力で DvorakJP

Last updated at Posted at 2015-10-03

OS X El Capitan の日本語入力で DvorakJP 配列を使うためにやったこと。

  1. System Integrity Protection を無効にする。
  2. DvorakJP ローマ字変換テーブルを作る。
  3. RomajiRule_Default.txt を書き換える。
  4. System Integrity Protection を有効にもどす。

System Integrity Protection を無効にする。

ローマ字変換テーブルは /System/Library/Input Methods/JapaneseIM.app/Contents/Resources/RomajiRule_Default.txt にあるので、El Capitan から搭載された System Integrity Protection を無効にしないと書き換えられない。

やり方はこのへん。csrutil コマンドを使う。

OS X 10.11 El Capitanのシステム保護機能「Rootless」を無効にするcsrutilコマンドの使い方。
http://applech2.com/archives/46435268.html

El Capitan 用の DvorakJP ローマ字変換テーブルを作る。

Google 日本語入力用の変換テーブルをコンバートして作る。
https://github.com/yuzuemon/google-japanese-input-romaji-table
これの dvorakjp-edited.txtPython で適当に変換。もとのテーブル RomajiRule_Default.txt にないやつだけ書き出してる。

出力されたやつを適当に編集してできあがったのが↓こちら。
https://gist.github.com/Saqoosha/494315111b8e2bc19ea5#file-romajirule_default-txt

# 無効 ってなってる行は、一応エントリはあるけど機能しないやつ。どうもキー入力が直接渡ってきてるわけじゃないっぽくて、記号類がすでに全角になってたりするので ',.; あたりのが含まれてるパターンが使えない。

RomajiRule_Default.txt を書き換える。

一応もとのやつをバックアップとった上で書き換える。

cd /System/Library/Input\ Methods/JapaneseIM.app/Contents/Resources
cp RomajiRule_Default.txt RomajiRule_Default_org.txt
cp ~/Desktop/RomajiRule_Default.txt .

書き換えただけでは有効にならないので OS 再起動。(killall -HUP JapaneseIM でも新しいテーブルで起動し直してくれるのだけど、すでに起動してるアプリで日本語入力できなくなったりするので OS ごと再起動しちゃうのがよいたぶん。)

System Integrity Protection を有効にもどす。

せっかく防御機能がついてるので戻しておきましょう。

El Capitan の日本語入力のローマ字変換テーブルのフォーマット

  • TSV
  • # 以降はコメントあつかい。
  • 1 カラム目、入力。
  • 2 カラム目、変換後。
  • 3 カラム目。変換後の文字数分、数字がならぶ。カンマ区切り。変化後が 1 文字ならいらない。
    • 変換後の文字それぞれが、もとの入力の何文字文からできてるか?みたいな?
    • マイナスになってるやつの意味がわからない。
    • 数があってなかったり不正なフォーマットだと日本語入力そのものが落ちる。

いろいろやってみたときの結果。

cnp  きゅう 2,1,1 # x: 落ちる
cnp  きゅう 2,1,0 # x: "cんゅ"
cnp  きゅう -2,1,0  # x: 落ちる
cnp  きゅう -1,2,0  # x: 落ちる
cnp  きゅう -0,2,1  # x: "cんう"
cnp  きゅう 0,1,2 # x: "ゅんp"
cnp  きゅう -0,1,2  # x: "ゅんp"
cnp  きゅう 0,-1,2  # x: 落ちる
cnp  きゅう 1,2,0 # x: "きんp"
cnp  きゅう -1,2,0  # x: 落ちる
cnp  きゅう -0,1,1  # x: 落ちる
cnp  きゅう -1,1,1  # x: 落ちる
cnp  きゅう 1,1,1 # x: きゅp
cnp  きゅう 0,0,3 # o: "きゅう" 1 word
cnp  きゅう 0,0,-3  # o: "きゅう" 1 word
cnp  きゅう 0,3,0 # x: "きゅ|う"
cnp  きゅう 0,-3,0  # x: きゅう -> ゅ
cnp  きゅう 3,0,0 # x: "き|ゅう"
cnp  きゅう -3,0,0  # x: バックスペースで削除できない
12
12
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
12