「のどか」設定ファイル @HHKB

# 設定ファイル
解説はこちら:[「のどか」で"HHKB"をカスタマイズ](http://qiita.com/rai_suta/items/2e7d990828cb57056e9c)

```mayu:dot.mayu
define USE109
include "read-keyboard-define.nodoka"       # キーボード定義

keymap Global
    # Mod2キーを定義
    def alias Modifier2     = 無変換
    mod mod2                = !!Modifier2
    key *Modifier2          = 半角/全角
    key R-*Modifier2        = &Ignore

include "KeyDef_mod2.mayu"

```

```mayu:KeyDef_mod2.mayu
include "KeySeq.mayu"

    # 編集ショートカット
    key M2-*    = *
    key Z       = C-Z                       # UNDO
    key X       = C-X                       # CUT
    key C       = C-C                       # COPY
    key V       = C-V                       # PASTE
    key Y       = C-Y                       # REDO
    key Comma   = $Edit/backward-kill-word  # 後方単語削除
    key FullStop = $Edit/kill-word          # 前方単語削除
    key M       = $Edit/kill-line           # 行末まで削除
    key N       = Return                    # 改行
    key H       = BackSpace                 # BS
    key G       = Delete                    # DEL
    key Q       = Esc                       # Esc
    key ~M2-    = ~
    
    # 移動
    key M2-*    = *
    key K       = ←
    key L       = →
    key S       = ↑
    key D       = ↓
    key J       = C-←                      # 単語
    key Semicolon = C-→
    key A       = PageUp                    # 頁
    key F       = PageDown
    key I       = Home                      # 行頭
    key O       = End
    key W       = C-Home                    # 頁頭
    key E       = C-End
    key ~M2-    = ~
    
######## Shiftロック ########
keymap kmp_shiftLock : Global
keyseq $Prefix_shiftLock    = &Prefix(kmp_shiftLock, false) &EditNextModifier(M2-)
    # モディファイヤキーのキーアップでは上手くPrefix出来ないので
    # キーマップ内ではモディファイヤ指定を外す
    mod mod2       -= Modifier2
    key *Modifier2  = &Ignore
    key U-*Modifier2 = &CancelPrefix
    key *Q          = &CancelPrefix
    
    # Shiftロック操作
    key M2-*        = S-*
    key K           = ←        $Prefix_shiftLock
    key L           = →        $Prefix_shiftLock
    key S           = ↑        $Prefix_shiftLock
    key D           = ↓        $Prefix_shiftLock
    key J           = C-←      $Prefix_shiftLock
    key Semicolon   = C-→      $Prefix_shiftLock
    key A           = PageUp    $Prefix_shiftLock
    key F           = PageDown  $Prefix_shiftLock
    key I           = Home      $Prefix_shiftLock
    key O           = End       $Prefix_shiftLock
    key W           = C-Home    $Prefix_shiftLock
    key E           = C-End     $Prefix_shiftLock
    key U           = $Edit/select-word     # 単語選択
    key ~M2-        = ~
keymap Global

    # Shiftロック開始h
    key M2-*LShift  = $Prefix_shiftLock
    key M2-*RShift  = $Prefix_shiftLock
    key M2-*U       = $Prefix_shiftLock

######## Ctrlロック ########
keymap kmp_ctrlLock : Global
keyseq $Prefix_ctrlLock    = &Prefix(kmp_ctrlLock, false) &EditNextModifier(M2-)
    mod mod2       -= Modifier2
    key *Modifier2  = &Ignore
    key U-*Modifier2 = &CancelPrefix
    key *Q          = &CancelPrefix
    
    # Ctrlロック操作
    key M2-*        = C-*
    key K           = ←        $Prefix_ctrlLock
    key L           = →        $Prefix_ctrlLock
    key S           = ↑        $Prefix_ctrlLock
    key D           = ↓        $Prefix_ctrlLock
    key ~M2-        = ~
keymap Global

    # Ctrlロック開始
    key D-M2-*LCtrl   = $Prefix_ctrlLock
    key D-M2-*RCtrl   = $Prefix_ctrlLock
    
######## Altロック ########
keymap kmp_altLock : Global
keyseq $Prefix_altLock    = &Prefix(kmp_altLock, false) &EditNextModifier(M2-)
    mod mod2       -= Modifier2
    key *Modifier2  = &Ignore
    key U-*Modifier2 = &CancelPrefix
    key *Q          = &CancelPrefix
    
    # Ctrlロック操作
    key M2-*        = A-*
    key K           = ←        $Prefix_altLock
    key L           = →        $Prefix_altLock
    key S           = ↑        $Prefix_altLock
    key D           = ↓        $Prefix_altLock
    key ~M2-        = ~
keymap Global

    # Altロック開始
    key M2-*LAlt      = $Prefix_altLock
    key M2-*RAlt      = $Prefix_altLock

```

```mayu:KeySeq.mayu
keyseq	$Edit/kill-word         = S-C-Right Delete      # 前進単語削除
keyseq	$Edit/backward-kill-word    = S-C-Left Delete   # 後退単語削除
keyseq	$Edit/kill-line         = S-End Delete          # １行削除

# 全てのロックキーを解除
keyseq $TurnOffLock     = &Toggle(Lock0, off) &Toggle(Lock1, off) &Toggle(Lock2, off) &Toggle(Lock3, off) \
                          &Toggle(Lock4, off) &Toggle(Lock5, off) &Toggle(Lock6, off) &Toggle(Lock7, off) \
                          &Toggle(Lock8, off) &Toggle(Lock9, off)

```