Edited at

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

More than 3 years have passed since last update.

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

uim-skk で DvorakJP 配列を扱うためメモです。

ここでは uim-1.8.6 が対象となっています。


DvorakJP とは

DvorakJP とは、 Dvorak 配列での入力を行い易くするために改良されたローマ字入力です。類似のものに AZIK(qwert y配列向け) や ACT(AZIK の Dvorak 配列版) があります。これらは元々 uim に入っています。


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

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


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

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

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


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

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


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

DvorakJP の配列 を見てみると、「q」の位置に「onn」とあります。

ところが、 SKK では、▽モード中の「q」は、平仮名、片仮名を反転したもので確定、という意味になっています。uim-skk の実装では、ローマ字入力の途中でもこの反転して確定という動作が優先されるため、子音+「q」が子音+「onn」になってくれません1

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


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

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


対策内容

ファイルひとつと、別のファイルへのパッチ適用を行います。

パス名は、 uim の共通ファイルが /usr/share/uim/ に置かれていると仮定したものです。

ファイル・パッチのいずれも 文字コードは EUC-JP として下さい。


DvorakJP 配列定義ファイル

まずは DvorakJP 配列の定義ファイル。いくつかミスってるところがあった気もするけどそのままアップ。

また、これは "US 配列" 用です。JP 配列の場合は、「ai」「an」(それぞれ2文字目が "'"";" になっているもの) の変更が必要です。


/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 位置の微妙な変更か、手で簡単に修正できる軽微なコンフリクトが発生するのみで、ほぼ同じものが使えています。


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
+ "D"
+ "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 専用になってしまっている。





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