uim-skk と DvorakJP を組み合わせて使う

*(途中に載せたファイルが長い……Gistに載せてリンク張った方がいいんだろうか)*

uim-skk で [DvorakJP](http://www7.plala.or.jp/dvorakjp/) 配列を扱うためメモです。
ここでは uim-1.8.6 が対象となっています。

## DvorakJP とは

DvorakJP とは、 Dvorak 配列での入力を行い易くするために改良されたローマ字入力です。類似のものに [AZIK](http://hp.vector.co.jp/authors/VA002116/azik/azikinfo.htm)(qwert y配列向け) や [ACT](http://www1.vecceed.ne.jp/~bemu/act/act_index.html)(AZIK の Dvorak 配列版) があります。これらは元々 uim に入っています。


## uim-skk と DvorakJP を組み合わせようとした時の問題点

uim-skk で DvorakJP を入力しようとすると、以下の問題があります。

 - そもそも DvorakJP 配列が定義されていない。
 - DvorakJP 配列定義を用意しても「q」を「onn」として扱えない。
 - 変換候補一覧の選択キーが a, s, d, f, ... で、 Dvorak では選択しにくい。

### そもそも DvorakJP 配列が定義されていない

対策: 配列定義を準備する。

### DvorakJP 配列定義を用意しても「q」を「onn」として扱えない

[DvorakJP の配列](http://www7.plala.or.jp/dvorakjp/dvorakjp.htm) を見てみると、「q」の位置に「onn」とあります。
ところが、 SKK では、▽モード中の「q」は、平仮名、片仮名を反転したもので確定、という意味になっています。uim-skk の実装では、ローマ字入力の途中でもこの反転して確定という動作が優先されるため、子音+「q」が子音+「onn」になってくれません[^1]。

対策: ローマ字入力中の「q」は、SKK 操作の「q」とみなさないようにパッチを当てる。

[^1]: 同じ問題が uim に元々入っている ACT にもあると思うのですが未確認です。

### 変換候補一覧の選択キーが a, s, d, f, ... で、 Dvorak では選択しにくい

対策: Dvorak に合わせた、 a, o, u, i, ... を用意する。

## 対策内容

ファイルひとつと、別のファイルへのパッチ適用を行います。
パス名は、 uim の共通ファイルが /usr/share/uim/ に置かれていると仮定したものです。
ファイル・パッチのいずれも **文字コードは EUC-JP** として下さい。


### DvorakJP 配列定義ファイル



まずは DvorakJP 配列の定義ファイル。いくつかミスってるところがあった気もするけどそのままアップ。
また、これは "US 配列" 用です。JP 配列の場合は、「ai」「an」(それぞれ2文字目が `"'"`、`";"` になっているもの) の変更が必要です。

```scm:/usr/share/uim/japanese-dvorakjp.scm
(define ja-dvorakjp-rule-basic
  '(
    ((("c" "a"). ())("か" "カ" "ｶ"))
    ((("c" "i"). ())("き" "キ" "ｷ"))
    ((("c" "u"). ())("く" "ク" "ｸ"))
    ((("c" "e"). ())("け" "ケ" "ｹ"))
    ((("c" "o"). ())("こ" "コ" "ｺ"))

    ((("c" "y"). ("y" "k"))("" "" ""))
    ((("c" "n"). ("y" "k"))("" "" ""))
    ((("k" "h"). ("y" "k"))("" "" ""))
    ((("g" "n"). ("y" "g"))("" "" ""))
    ((("z" "h"). ("y" "z"))("" "" ""))
    ((("t" "n"). ("y" "t"))("" "" ""))
    ((("n" "h"). ("y" "n"))("" "" ""))
    ((("h" "n"). ("y" "h"))("" "" ""))
    ((("b" "n"). ("y" "b"))("" "" ""))
    ((("p" "h"). ("y" "p"))("" "" ""))
    ((("m" "n"). ("y" "m"))("" "" ""))
    ((("l" "h"). ("y" "l"))("" "" ""))
    ((("r" "h"). ("y" "r"))("" "" ""))
    ((("p" "h"). ("y" "p"))("" "" ""))
    ))

(define ja-dvorakjp-rule-double-contr
  '(
    ((("k" "'"). ())("かい" "カイ" "ｶｲ"))
    ((("k" ","). ())("こう" "コウ" "コウ"))
    ((("k" "."). ())("けい" "ケイ" "ｹｲ"))
    ((("k" ";"). ())("かん" "カン" "ｶﾝ"))
    ((("k" "q"). ())("こん" "コン" "コン"))
    ((("k" "j"). ())("けん" "ケン" "ｹﾝ"))
    ;; ((("k" "k"). ())("くん" "クン" "ｸﾝ"))
    ((("k" "x"). ())("きん" "キン" "ｷﾝ"))

    ((("c" "'"). ())("かい" "カイ" "ｶｲ"))
    ((("c" ","). ())("こう" "コウ" "ｺｳ"))
    ((("c" "."). ())("けい" "ケイ" "ｹｲ"))
    ((("c" ";"). ())("かん" "カン" "ｶﾝ"))
    ((("c" "q"). ())("こん" "コン" "ｺﾝ"))
    ((("c" "j"). ())("けん" "ケン" "ｹﾝ"))
    ((("c" "k"). ())("くん" "クン" "ｸﾝ"))
    ((("c" "x"). ())("きん" "キン" "ｷﾝ"))

    ((("c" "h" "'"). ())("ちゃい" "チャイ" "ﾁｬｲ"))
    ((("c" "h" ","). ())("ちょう" "チョウ" "ﾁｮｳ"))
    ((("c" "h" "."). ())("ちぇい" "チェイ" "ﾁｪｲ"))
    ((("c" "h" ";"). ())("ちゃん" "チャン" "ﾁｬﾝ"))
    ((("c" "h" "q"). ())("ちょん" "チョン" "ﾁｮﾝ"))
    ((("c" "h" "j"). ())("ちぇん" "チェン" "ﾁｪﾝ"))
    ((("c" "h" "k"). ())("ちゅん" "チュン" "ﾁｭﾝ"))
    ((("c" "h" "x"). ())("ちん" "チン" "ﾁﾝ"))

    ((("k" "y" "'"). ())("きゃい" "キャイ" "ｷｬｲ"))
    ((("k" "y" ","). ())("きょう" "キョウ" "ｷｮｳ"))
    ((("k" "y" "."). ())("きぇい" "キェイ" "ｷｪｲ"))
    ((("k" "y" ";"). ())("きゃん" "キャン" "ｷｬﾝ"))
    ((("k" "y" "q"). ())("きょん" "キョン" "ｷｮﾝ"))
    ((("k" "y" "j"). ())("きぇん" "キェン" "ｷｪﾝ"))
    ((("k" "y" "k"). ())("きゅん" "キュン" "ｷｭﾝ"))
    ((("k" "y" "x"). ())("きぃん" "キィン" "ｷｨﾝ"))

    ((("g" "'"). ())("がい" "ガイ" "ｶﾞｲ"))
    ((("g" ","). ())("ごう" "ゴウ" "ｺﾞｳ"))
    ((("g" "."). ())("げい" "ゲイ" "ｹﾞｲ"))
    ((("g" ";"). ())("がん" "ガン" "ｶﾞﾝ"))
    ((("g" "q"). ())("ごん" "ゴン" "ｺﾞﾝ"))
    ((("g" "j"). ())("げん" "ゲン" "ｹﾞﾝ"))
    ((("g" "k"). ())("ぐん" "グン" "ｸﾞﾝ"))
    ((("g" "x"). ())("ぎん" "ギン" "ｷﾞﾝ"))

    ((("g" "y" "'"). ())("ぎゃい" "ギャイ" "ｷﾞｬｲ"))
    ((("g" "y" ","). ())("ぎょう" "ギョウ" "ｷﾞｮｳ"))
    ((("g" "y" "."). ())("ぎぇい" "ギェイ" "ｷﾞｪｲ"))
    ((("g" "y" ";"). ())("ぎゃん" "ギャン" "ｷﾞｬﾝ"))
    ((("g" "y" "q"). ())("ぎょん" "ギョン" "ｷﾞｮﾝ"))
    ((("g" "y" "j"). ())("ぎぇん" "ギェン" "ｷﾞｪﾝ"))
    ((("g" "y" "k"). ())("ぎゅん" "ギュン" "ｷﾞｭﾝ"))
    ((("g" "y" "x"). ())("ぎぃん" "ギィン" "ｷﾞｭﾝ"))

    ((("s" "'"). ())("さい" "サイ" "ｻｲ"))
    ((("s" ","). ())("そう" "ソウ" "ｿｳ"))
    ((("s" "."). ())("せい" "セイ" "ｾｲ"))
    ((("s" ";"). ())("さん" "サン" "ｻﾝ"))
    ((("s" "q"). ())("そん" "ソン" "ｿﾝ"))
    ((("s" "j"). ())("せん" "セン" "ｾﾝ"))
    ((("s" "k"). ())("すん" "スン" "ｽﾝ"))
    ((("s" "x"). ())("しん" "シン" "ｼﾝ"))

    ((("s" "h" "'"). ())("しゃい" "シャイ" "ｼｬｲ"))
    ((("s" "h" ","). ())("しょう" "ショウ" "ｼｮｳ"))
    ((("s" "h" "."). ())("しぇい" "シェイ" "ｼｪｲ"))
    ((("s" "h" ";"). ())("しゃん" "シャン" "ｼｬﾝ"))
    ((("s" "h" "q"). ())("しょん" "ション" "ｼｮﾝ"))
    ((("s" "h" "j"). ())("しぇん" "シェン" "ｼｪﾝ"))
    ((("s" "h" "k"). ())("しゅん" "シュン" "ｼｭﾝ"))
    ((("s" "h" "x"). ())("しん" "シン" "ｼﾝ"))

    ;;;
    ((("s" "y" "'"). ())("しゃい" "シャイ" "ｼｬｲ"))
    ((("s" "y" ","). ())("しょう" "ショウ" "ｼｮｳ"))
    ((("s" "y" "."). ())("しぇい" "シェイ" "ｼｪｲ"))
    ((("s" "y" ";"). ())("しゃん" "シャン" "ｼｬﾝ"))
    ((("s" "y" "q"). ())("しょん" "ション" "ｼｮﾝ"))
    ((("s" "y" "j"). ())("しぇん" "シェン" "ｼｪﾝ"))
    ((("s" "y" "k"). ())("しゅん" "シュン" "ｼｭﾝ"))
    ((("s" "y" "x"). ())("しぃん" "シィン" "ｼｨﾝ"))

    ((("z" "'"). ())("ざい" "ザイ" "ｻﾞｲ"))
    ((("z" ","). ())("ぞう" "ゾウ" "ｿﾞｳ"))
    ((("z" "."). ())("ぜい" "ゼイ" "ｾﾞｲ"))
    ((("z" ";"). ())("ざん" "ザン" "ｻﾞﾝ"))
    ((("z" "q"). ())("ぞん" "ゾン" "ｿﾞﾝ"))
    ((("z" "j"). ())("ぜん" "ゼン" "ｾﾞﾝ"))
    ((("z" "k"). ())("ずん" "ズン" "ｽﾞﾝ"))
    ((("z" "x"). ())("じん" "ジン" "ｼﾞﾝ"))

    ((("z" "y" "'"). ())("じゃい" "ジャイ" "ｼﾞｬｲ"))
    ((("z" "y" ","). ())("じょう" "ジョウ" "ｼﾞｮｳ"))
    ((("z" "y" "."). ())("じぇい" "ジェイ" "ｼﾞｪｲ"))
    ((("z" "y" ";"). ())("じゃん" "ジャン" "ｼﾞｬﾝ"))
    ((("z" "y" "q"). ())("じょん" "ジョン" "ｼﾞｮﾝ"))
    ((("z" "y" "j"). ())("じぇん" "ジェン" "ｼﾞｪﾝ"))
    ((("z" "y" "k"). ())("じゅん" "ジュン" "ｼﾞｭﾝ"))
    ((("z" "y" "x"). ())("じぃん" "ジィン" "ｼﾞｨﾝ"))

    ((("j" "'"). ())("じゃい" "ジャイ" "ｼﾞｬｲ"))
    ((("j" ","). ())("じょう" "ジョウ" "ｼﾞｮｳ"))
    ((("j" "."). ())("じぇい" "ジェイ" "ｼﾞｪｲ"))
    ((("j" ";"). ())("じゃん" "ジャン" "ｼﾞｬﾝ"))
    ((("j" "q"). ())("じょん" "ジョン" "ｼﾞｮﾝ"))
    ;;((("j" "j"). ())("じぇん" "ジェン" "ｼﾞｪﾝ"))
    ((("j" "k"). ())("じゅん" "ジュン" "ｼﾞｭﾝ"))
    ((("j" "x"). ())("じん" "ジン" "ｼﾞﾝ"))

    ((("j" "y" "'"). ())("じゃい" "ジャイ" "ｼﾞｬｲ"))
    ((("j" "y" ","). ())("じょう" "ジョウ" "ｼﾞｮｳ"))
    ((("j" "y" "."). ())("じぇい" "ジェイ" "ｼﾞｪｲ"))
    ((("j" "y" ";"). ())("じゃん" "ジャン" "ｼﾞｬﾝ"))
    ((("j" "y" "q"). ())("じょん" "ジョン" "ｼﾞｮﾝ"))
    ((("j" "y" "j"). ())("じぇん" "ジェン" "ｼﾞｪﾝ"))
    ((("j" "y" "k"). ())("じゅん" "ジュン" "ｼﾞｭﾝ"))
    ((("j" "y" "x"). ())("じぃん" "ジィン" "ｼﾞｨﾝ"))

    ((("t" "'"). ())("たい" "タイ" "ﾀｲ"))
    ((("t" ","). ())("とう" "トウ" "ﾄｳ"))
    ((("t" "."). ())("てい" "テイ" "ﾃｲ"))
    ((("t" ";"). ())("たん" "タン" "ﾀﾝ"))
    ((("t" "q"). ())("とん" "トン" "ﾄﾝ"))
    ((("t" "j"). ())("てん" "テン" "ﾃﾝ"))
    ((("t" "k"). ())("つん" "ツン" "ﾂﾝ"))
    ((("t" "x"). ())("ちん" "チン" "ﾁﾝ"))

    ((("t" "y" "'"). ())("ちゃい" "チャイ" "ﾁｬｲ"))
    ((("t" "y" ","). ())("ちょう" "チョウ" "ﾁｮｳ"))
    ((("t" "y" "."). ())("ちぇい" "チェイ" "ﾁｪｲ"))
    ((("t" "y" ";"). ())("ちゃん" "チャン" "ﾁｬﾝ"))
    ((("t" "y" "q"). ())("ちょん" "チョン" "ﾁｮﾝ"))
    ((("t" "y" "j"). ())("ちぇん" "チェン" "ﾁｪﾝ"))
    ((("t" "y" "k"). ())("ちゅん" "チュン" "ﾁｭﾝ"))
    ((("t" "y" "x"). ())("ちぃん" "チィン" "ﾁｨﾝ"))

    ((("t" "s" "'"). ())("つぁい" "ツァイ" "ﾂｧｲ"))
    ((("t" "s" ","). ())("つぉう" "ツォウ" "ﾂｫｳ"))
    ((("t" "s" "."). ())("つぇい" "ツェイ" "ﾂｪｲ"))
    ((("t" "s" ";"). ())("つぁん" "ツァン" "ﾂｧﾝ"))
    ((("t" "s" "q"). ())("つぉん" "ツォン" "ﾂｫﾝ"))
    ((("t" "s" "j"). ())("つぇん" "ツェン" "ﾂｪﾝ"))
    ((("t" "s" "k"). ())("つん" "ツン" "ﾂﾝ"))
    ((("t" "s" "x"). ())("つぃん" "ツィン" "ﾂｨﾝ"))

    ((("t" "h" "'"). ())("てゃい" "テャイ" "ﾃｬｲ"))
    ((("t" "h" ","). ())("てょう" "テョウ" "ﾃｮｳ"))
    ((("t" "h" "."). ())("てぇい" "テェイ" "ﾃｪｲ"))
    ((("t" "h" ";"). ())("てゃん" "テャン" "ﾃｬﾝ"))
    ((("t" "h" "q"). ())("てょん" "テョン" "ﾃｮﾝ"))
    ((("t" "h" "j"). ())("てぇん" "テェン" "ﾃｪﾝ"))
    ((("t" "h" "k"). ())("てゅ" "テュン" "ﾃｭﾝ"))
    ((("t" "h" "x"). ())("てぃん" "ティン" "ﾃｨﾝ"))

    ((("c" "y" "'"). ())("きゃい" "キャイ" "ｷｬｲ"))
    ((("c" "y" ","). ())("きょう" "キョウ" "ｷｮｳ"))
    ((("c" "y" "."). ())("きぇい" "キェイ" "ｷｪｲ"))
    ((("c" "y" ";"). ())("きゃん" "キャン" "ｷｬﾝ"))
    ((("c" "y" "q"). ())("きょん" "キョン" "ｷｮﾝ"))
    ((("c" "y" "j"). ())("きぇん" "キェン" "ｷｪﾝ"))
    ((("c" "y" "k"). ())("きゅん" "キュン" "ｷｭﾝ"))
    ((("c" "y" "x"). ())("きぃん" "キィン" "ｷｨﾝ"))

    ((("d" "'"). ())("だい" "ダイ" "ﾀﾞｲ"))
    ((("d" ","). ())("どう" "ドウ" "ﾄﾞｳ"))
    ((("d" "."). ())("でい" "デイ" "ﾃﾞｲ"))
    ((("d" ";"). ())("だん" "ダン" "ﾀﾞﾝ"))
    ((("d" "q"). ())("どん" "ドン" "ﾄﾞﾝ"))
    ((("d" "j"). ())("でん" "デン" "ﾃﾞﾝ"))
    ((("d" "k"). ())("づん" "ヅン" "ﾂﾞﾝ"))
    ((("d" "x"). ())("ぢん" "ヂン" "ﾁﾞﾝ"))

    ((("d" "y" "'"). ())("ぢゃい" "ヂャイ" "ﾁﾞｬｲ"))
    ((("d" "y" ","). ())("ぢょう" "ヂョウ" "ﾁﾞｮｳ"))
    ((("d" "y" "."). ())("ぢぇい" "ヂェイ" "ﾁﾞｪｲ"))
    ((("d" "y" ";"). ())("ぢゃん" "ヂャン" "ﾁﾞｬﾝ"))
    ((("d" "y" "q"). ())("ぢょん" "ヂョン" "ﾁﾞｮﾝ"))
    ((("d" "y" "j"). ())("ぢぇん" "ヂェン" "ﾁﾞｪﾝ"))
    ((("d" "y" "k"). ())("ぢゅん" "ヂュン" "ﾁﾞｭﾝ"))
    ((("d" "y" "x"). ())("ぢぃん" "ヂィン" "ﾁﾞｨﾝ"))

    ((("n" "'"). ())("ない" "ナイ" "ﾅｲ"))
    ((("n" ","). ())("のう" "ノウ" "ﾉｳ"))
    ((("n" "."). ())("ねい" "ネイ" "ﾈｲ"))
    ((("n" ";"). ())("なん" "ナン" "ﾅﾝ"))
    ((("n" "q"). ())("のん" "ノン" "ﾉﾝ"))
    ((("n" "j"). ())("ねん" "ネン" "ﾈﾝ"))
    ((("n" "k"). ())("ぬん" "ヌン" "ﾇﾝ"))
    ((("n" "x"). ())("にん" "ニン" "ﾆﾝ"))

    ((("n" "y" "'"). ())("にゃい" "ニャイ" "ﾆｬｲ"))
    ((("n" "y" ","). ())("にょう" "ニョウ" "ﾆｮｳ"))
    ((("n" "y" "."). ())("にぇい" "ニェイ" "ﾆｪｲ"))
    ((("n" "y" ";"). ())("にゃん" "ニャン" "ﾆｬﾝ"))
    ((("n" "y" "q"). ())("にょん" "ニョン" "ﾆｮﾝ"))
    ((("n" "y" "j"). ())("にぇん" "ニェン" "ﾆｪﾝ"))
    ((("n" "y" "k"). ())("にゅん" "ニュン" "ﾆｭﾝ"))
    ((("n" "y" "x"). ())("にぃん" "ニィン" "ﾆｨﾝ"))

    ((("h" "'"). ())("はい" "ハイ" "ﾊｲ"))
    ((("h" ","). ())("ほう" "ホウ" "ﾎｳ"))
    ((("h" "."). ())("へい" "ヘイ" "ﾍｲ"))
    ((("h" ";"). ())("はん" "ハン" "ﾊﾝ"))
    ((("h" "q"). ())("ほん" "ホン" "ﾎﾝ"))
    ((("h" "j"). ())("へん" "ヘン" "ﾍﾝ"))
    ((("h" "k"). ())("ふん" "フン" "ﾌﾝ"))
    ((("h" "x"). ())("ひん" "ヒン" "ﾋﾝ"))

    ((("h" "y" "'"). ())("ひゃい" "ヒャイ" "ﾋｬｲ"))
    ((("h" "y" ","). ())("ひょう" "ヒョウ" "ﾋｮｳ"))
    ((("h" "y" "."). ())("ひぇい" "ヒェイ" "ﾋｪｲ"))
    ((("h" "y" ";"). ())("ひゃん" "ヒャン" "ﾋｬﾝ"))
    ((("h" "y" "q"). ())("ひょん" "ヒョン" "ﾋｮﾝ"))
    ((("h" "y" "j"). ())("ひぇん" "ヒェン" "ﾋｪﾝ"))
    ((("h" "y" "k"). ())("ひゅん" "ヒュン" "ﾋｭﾝ"))
    ((("h" "y" "x"). ())("ひぃん" "ヒィン" "ﾋｨﾝ"))

    ((("f" "'"). ())("ふぁい" "ファイ" "ﾌｧｲ"))
    ((("f" ","). ())("ふぉう" "フォウ" "ﾌｫｳ"))
    ((("f" "."). ())("ふぇい" "フェイ" "ﾌｪｲ"))
    ((("f" ";"). ())("ふぁん" "ファン" "ﾌｧﾝ"))
    ((("f" "q"). ())("ふぉん" "フォン" "ﾌｫﾝ"))
    ((("f" "j"). ())("ふぇん" "フェン" "ﾌｪﾝ"))
    ((("f" "k"). ())("ふん" "フン" "ﾌﾝ"))
    ((("f" "x"). ())("ふぃん" "フィン" "ﾌｨﾝ"))

    ((("f" "y" "'"). ())("ふゃい" "フャイ" "ﾌｬｲ"))
    ((("f" "y" ","). ())("ふょう" "フョウ" "ﾌｮｳ"))
    ((("f" "y" "."). ())("ふぇい" "フェイ" "ﾌｪｲ"))
    ((("f" "y" ";"). ())("ふゃん" "フャン" "ﾌｬﾝ"))
    ((("f" "y" "q"). ())("ふょん" "フョン" "ﾌｮﾝ"))
    ((("f" "y" "j"). ())("ふぇん" "フェン" "ﾌｪﾝ"))
    ((("f" "y" "k"). ())("ふゅん" "フュン" "ﾌｭﾝ"))
    ((("f" "y" "x"). ())("ふぃん" "フィン" "ﾌｨﾝ"))

    ((("b" "'"). ())("ばい" "バイ" "ﾊﾞｲ"))
    ((("b" ","). ())("ぼう" "ボウ" "ﾎﾞｳ"))
    ((("b" "."). ())("べい" "ベイ" "ﾍﾞｲ"))
    ((("b" ";"). ())("ばん" "バン" "ﾊﾞﾝ"))
    ((("b" "q"). ())("ぼん" "ボン" "ﾎﾞﾝ"))
    ((("b" "j"). ())("べん" "ベン" "ﾍﾞﾝ"))
    ((("b" "k"). ())("ぶん" "ブン" "ﾌﾞﾝ"))
    ((("b" "x"). ())("びん" "ビン" "ﾋﾞﾝ"))

    ((("b" "y" "'"). ())("びゃい" "ビャイ" "ﾋﾞｬｲ"))
    ((("b" "y" ","). ())("びょう" "ビョウ" "ﾋﾞｮｳ"))
    ((("b" "y" "."). ())("びぇい" "ビェイ" "ﾋﾞｪｲ"))
    ((("b" "y" ";"). ())("びゃん" "ビャン" "ﾋﾞｬﾝ"))
    ((("b" "y" "q"). ())("びょん" "ビョン" "ﾋﾞｮﾝ"))
    ((("b" "y" "j"). ())("びぇん" "ビェン" "ﾋﾞｪﾝ"))
    ((("b" "y" "k"). ())("びゅん" "ビュン" "ﾋﾞｭﾝ"))
    ((("b" "y" "x"). ())("びぃん" "ビィン" "ﾋﾞｨﾝ"))

    ((("p" "'"). ())("ぱい" "パイ" "ﾊﾟｲ"))
    ((("p" ","). ())("ぽう" "ポウ" "ﾎﾟｳ"))
    ((("p" "."). ())("ぺい" "ペイ" "ﾍﾟｲ"))
    ((("p" ";"). ())("ぱん" "パン" "ﾊﾟﾝ"))
    ((("p" "q"). ())("ぽん" "ポン" "ﾎﾟﾝ"))
    ((("p" "j"). ())("ぺん" "ペン" "ﾍﾟﾝ"))
    ((("p" "k"). ())("ぷん" "プン" "ﾌﾟﾝ"))
    ((("p" "x"). ())("ぴん" "ピン" "ﾋﾟﾝ"))

    ((("p" "y" "'"). ())("ぴゃい" "ピャイ" "ﾋﾟｬｲ"))
    ((("p" "y" ","). ())("ぴょう" "ピョウ" "ﾋﾟｮｳ"))
    ((("p" "y" "."). ())("ぴぇい" "ピェイ" "ﾋﾟｪｲ"))
    ((("p" "y" ";"). ())("ぴゃん" "ピャン" "ﾋﾟｬﾝ"))
    ((("p" "y" "q"). ())("ぴょん" "ピョン" "ﾋﾟｮﾝ"))
    ((("p" "y" "j"). ())("ぴぇん" "ピェン" "ﾋﾟｪﾝ"))
    ((("p" "y" "k"). ())("ぴゅん" "ピュン" "ﾋﾟｭﾝ"))
    ((("p" "y" "x"). ())("ぴぃん" "ピィン" "ﾋﾟｨﾝ"))

    ((("m" "'"). ())("まい" "マイ" "ﾏｲ"))
    ((("m" ","). ())("もう" "モウ" "ﾓｳ"))
    ((("m" "."). ())("めい" "メイ" "ﾒｲ"))
    ((("m" ";"). ())("まん" "マン" "ﾏﾝ"))
    ((("m" "q"). ())("もん" "モン" "ﾓﾝ"))
    ((("m" "j"). ())("めん" "メン" "ﾒﾝ"))
    ((("m" "k"). ())("むん" "ムン" "ﾑﾝ"))
    ((("m" "x"). ())("みん" "ミン" "ﾐﾝ"))

    ((("m" "y" "'"). ())("みゃい" "ミャイ" "ﾐｬｲ"))
    ((("m" "y" ","). ())("みょう" "ミョウ" "ﾐｮｳ"))
    ((("m" "y" "."). ())("みぇい" "ミェイ" "ﾐｪｲ"))
    ((("m" "y" ";"). ())("みゃん" "ミャン" "ﾐｬﾝ"))
    ((("m" "y" "q"). ())("みょん" "ミョン" "ﾐｮﾝ"))
    ((("m" "y" "j"). ())("みぇん" "ミェン" "ﾐｪﾝ"))
    ((("m" "y" "k"). ())("みゅん" "ミュン" "ﾐｭﾝ"))
    ((("m" "y" "x"). ())("みぃん" "ミィン" "ﾐｨﾝ"))

    ((("y" "'"). ())("やい" "ヤイ" "ﾔｲ"))
    ((("y" ","). ())("よう" "ヨウ" "ﾖｳ"))
    ((("y" "."). ())("いぇい" "イェイ" "ｲｪｲ"))
    ((("y" ";"). ())("やん" "ヤン" "ﾔﾝ"))
    ((("y" "q"). ())("よん" "ヨン" "ﾖﾝ"))
    ((("y" "j"). ())("いぇん" "イェン" "ｲｪﾝ"))
    ((("y" "k"). ())("ゆん" "ユン" "ﾕﾝ"))

    ((("r" "'"). ())("らい" "ライ" "ﾗｲ"))
    ((("r" ","). ())("ろう" "ロウ" "ﾛｳ"))
    ((("r" "."). ())("れい" "レイ" "ﾚｲ"))
    ((("r" ";"). ())("らん" "ラン" "ﾗﾝ"))
    ((("r" "q"). ())("ろん" "ロン" "ﾛﾝ"))
    ((("r" "j"). ())("れん" "レン" "ﾚﾝ"))
    ((("r" "k"). ())("るん" "ルン" "ﾙﾝ"))
    ((("r" "x"). ())("りん" "リン" "ﾘﾝ"))

    ((("l" "y" "'"). ())("りゃい" "リャイ" "ﾘｬｲ"))
    ((("l" "y" ","). ())("りょう" "リョウ" "ﾘｮｳ"))
    ((("l" "y" "."). ())("りぇい" "リェイ" "ﾘｪｲ"))
    ((("l" "y" ";"). ())("りゃん" "リャン" "ﾘｬﾝ"))
    ((("l" "y" "q"). ())("りょん" "リョン" "ﾘｮﾝ"))
    ((("l" "y" "j"). ())("りぇん" "リェン" "ﾘｪﾝ"))
    ((("l" "y" "k"). ())("りゅん" "リュン" "ﾘｭﾝ"))
    ((("l" "y" "x"). ())("りぃん" "リィン" "ﾘｨﾝ"))

    ((("r" "y" "'"). ())("りゃい" "リャイ" "ﾘｬｲ"))
    ((("r" "y" ","). ())("りょう" "リョウ" "ﾘｮｳ"))
    ((("r" "y" "."). ())("りぇい" "リェイ" "ﾘｪｲ"))
    ((("r" "y" ";"). ())("りゃん" "リャン" "ﾘｬﾝ"))
    ((("r" "y" "q"). ())("りょん" "リョン" "ﾘｮﾝ"))
    ((("r" "y" "j"). ())("りぇん" "リェン" "ﾘｪﾝ"))
    ((("r" "y" "k"). ())("りゅん" "リュン" "ﾘｭﾝ"))
    ((("r" "y" "x"). ())("りぃん" "リィン" "ﾘｨﾝ"))

    ((("w" "'"). ())("わい" "ワイ" "ﾜｲ"))
    ((("w" ","). ())("をう" "ヲウ" "ｦｳ"))
    ((("w" "."). ())("うぇい" "ウェイ" "ｳｪｲ"))
    ((("w" ";"). ())("わん" "ワン" "ﾜﾝ"))
    ((("w" "q"). ())("をん" "ヲン" "ｦﾝ"))
    ((("w" "j"). ())("うぇん" "ウェン" "ｳｪﾝ"))
    ((("w" "k"). ())("うん" "ウン" "ｳﾝ"))
    ((("w" "x"). ())("うぃん" "ウィン" "ｳｨﾝ"))

    ((("w" "h" "'"). ())("うぁい" "ウァイ" "ｳｧｲ"))
    ((("w" "h" ","). ())("うぉう" "ウォウ" "ｳｫｳ")) 
    ((("w" "h" "."). ())("うぇい" "ウェイ" "ｳｪｲ")) 
    ((("w" "h" ";"). ())("うぁん" "ウァン" "ｳｧﾝ"))
    ((("w" "h" "q"). ())("うぉん" "ウォン" "ｳｫﾝ")) 
    ((("w" "h" "j"). ())("うぇん" "ウェン" "ｳｪﾝ")) 
    ((("w" "h" "k"). ())("うゅん" "ウュン" "ｳｭﾝ"))
    ((("w" "h" "x"). ())("うぃん" "ウィン" "ｳｨﾝ"))

    ((("v" "'"). ())("う゛ぁい" "ヴァイ" "ｳﾞｧｲ"))
    ((("v" ","). ())("う゛ぉう" "ヴォウ" "ｳﾞｫｳ"))
    ((("v" "."). ())("う゛ぇい" "ヴェイ" "ｳﾞｪｲ"))
    ((("v" ";"). ())("う゛ぁん" "ヴァン" "ｳﾞｧﾝ"))
    ((("v" "q"). ())("う゛ぉん" "ヴォン" "ｳﾞｫﾝ"))
    ((("v" "j"). ())("う゛ぇん" "ヴェン" "ｳﾞｪﾝ"))
    ((("v" "k"). ())("う゛ん" "ヴン" "ｳﾞﾝ"))
    ((("v" "x"). ())("う゛ぃん" "ヴィン" "ｳﾞｨﾝ"))
    ))


(define rk-rule-begins-with?
  (lambda (x)
    (lambda (rule)
      (let ((head (caar rule))
	    (begins-with? (lambda (self xs ys)
			    (or (null? ys)
				(and (not (null? xs))
				     (string=? (car xs) (car ys))
				     (self self (cdr xs) (cdr ys)))))))
	(begins-with? begins-with? head x)))))

(define ja-dvorakjp-rule (append
			   ja-dvorakjp-rule-basic
			   ja-dvorakjp-rule-double-contr
			   ;; filter out rules that begin with ("t" "'") from default ja-rk-rule.
			   (filter (lambda (x) (not ((rk-rule-begins-with? '("t" "'")) x))) ja-rk-rule)))

(define ja-dvorakjp-skk-okuri-char-alist '())
(define ja-dvorakjp-skk-downcase-alist '())
(define ja-dvorakjp-skk-set-henkan-point-key '())
```


### skk.scm へのパッチ

次に、skk.scm に対するパッチ。
DvorakJP 配列を Anthy などでも使いたければ、そちらも変更する必要がありますが、私は専ら SKK ですのでこれだけ。

なお、これは uim-1.8.6 のファイルに対するパッチですが、uim-1.6.* の頃から hunk 位置の微妙な変更か、手で簡単に修正できる軽微なコンフリクトが発生するのみで、ほぼ同じものが使えています。

```diff:skk.scm.patch
--- skk.scm.orig	2015-09-06 23:17:21.492707994 +0900
+++ skk.scm	2015-09-07 22:45:04.753066187 +0900
@@ -56,7 +56,9 @@
 ;; encoding conversion problem.  -- YamaKen 2005-02-02
 (define skk-auto-start-henkan-keyword-list '("を" "、" "。" "．" "，" "？" "」" "！" "；" "：" ")" ";" ":" "）" "”" "】" "』" "》" "〉" "｝" "］" "〕" "}" "]" "?" "." "," "!"))
 
-(define skk-ddskk-like-heading-label-char-list '("a" "s" "d" "f" "j" "k" "l"))
+;; dvorak-style
+;;(define skk-ddskk-like-heading-label-char-list '("a" "s" "d" "f" "j" "k" "l"))
+(define skk-ddskk-like-heading-label-char-list '("a" "o" "d" "u" "h" "t" "n"))
 (define skk-uim-heading-label-char-list '("1" "2" "3" "4" "5" "6" "7" "8" "9" "0"))
 
 (define skk-ja-rk-rule (append ja-rk-rule-basic ja-rk-rule-additional))
@@ -150,6 +152,7 @@
 (define skk-input-rule-azik 1)
 (define skk-input-rule-act 2)
 (define skk-input-rule-kzik 3)
+(define skk-input-rule-dvorakjp 4)
 
 (define skk-child-type-editor 0)
 (define skk-child-type-dialog 1)
@@ -323,6 +326,21 @@
 		     (skk-prepare-activation dsc)
 		     (skk-set-rule! dsc skk-input-rule-kzik))))
 
+(register-action 'action_skk_dvorakjp
+		 (lambda (sc)
+		   '(ja_dvorakjp
+		     "Ｄ"
+		     "DvorakJP"
+		     "DvorakJP拡張ローマ字入力モード"))
+		 (lambda (sc)
+		   (let ((dsc (skk-find-descendant-context sc)))
+		     (= (skk-context-input-rule dsc)
+			skk-input-rule-dvorakjp)))
+		 (lambda (sc)
+		   (let ((dsc (skk-find-descendant-context sc)))
+		     (skk-prepare-activation dsc)
+		     (skk-set-rule! dsc skk-input-rule-dvorakjp))))
+
 ;; Update widget definitions based on action configurations. The
 ;; procedure is needed for on-the-fly reconfiguration involving the
 ;; custom API
@@ -392,7 +410,13 @@
                   (set! skk-okuri-char-alist '())
                   (set! skk-downcase-alist '())
                   (set! skk-set-henkan-point-key '())
-		  ja-kzik-rule))))
+		  ja-kzik-rule)
+		 ((= input-rule skk-input-rule-dvorakjp)
+		  (require "japanese-dvorakjp.scm")
+                  (set! skk-okuri-char-alist ja-dvorakjp-skk-okuri-char-alist)
+                  (set! skk-downcase-alist ja-dvorakjp-skk-downcase-alist)
+                  (set! skk-set-henkan-point-key ja-dvorakjp-skk-set-henkan-point-key)
+		  ja-dvorakjp-rule))))
       (skk-context-set-input-rule! sc input-rule)
       (rk-context-set-rule! rkc rule))))
 
@@ -1585,7 +1609,9 @@
 		   (skk-append-residual-kana sc)
 		   #t)))
 	   #t)
-       (if (skk-kana-toggle-key? key key-state)
+       ;; hack by yoh2
+       (if (and (skk-kana-toggle-key? key key-state)
+		(null? (rk-context-seq rkc)))
 	   (begin
 	     (skk-append-residual-kana sc)
 	     (if (not (null? (skk-context-head sc)))
```


## 今後の課題

と言いつつ、数年間使い続けていて、大体満足しているのでほったらかしにする可能性大。

 - 「ai」「ann(の大文字版)」がJP配列とUS配列で異なっているが、これのうまい扱い方はないか。現状は使っているキーボードに合わせてファイルを差し替えています。1 台の PC に多種類のキーボードを接続する使い方をしませんので。
 - uim-1.9 以降の対応確認 (カスタマイズ以前にそもそもビルドできてません……)。
 - 変換候補一覧の選択キーが、今度は Dvorak 専用になってしまっている。