keyhac設定

```python
import sys
import os
import datetime

import pyauto
from keyhac import *


def configure(keymap):

    # --------------------------------------------------------------------
    # Text editer setting for editting config.py file

    # Setting with program file path (Simple usage)
    if 1:
        keymap.editor = "notepad.exe"

    # Setting with callable object (Advanced usage)
    if 0:
        def editor(path):
            shellExecute( None, "notepad.exe", '"%s"'% path, "" )
        keymap.editor = editor

    # --------------------------------------------------------------------
    # Customizing the display

    # Font
    keymap.setFont( "MS Gothic", 12 )

    # Theme
    keymap.setTheme("black")

    # --------------------------------------------------------------------


    # 参考サイト
    # http://crftwr.github.io/keyhac/doc/ja/index.html
    # https://qiita.com/AWtnb/items/5eafc1ef6846f39fca76


    # -------------- 追加 ----------------
    # 変換／無変換キーを user modifier とする
    keymap.replaceKey("(29)", 235)      # 無変換（29）を 235 とする
    keymap.defineModifier(235, "User0") # 無変換を U0 修飾キーとして使う
    keymap.replaceKey("(28)", 236)      # 変換（28）を 236 とする
    keymap.defineModifier(236, "User1") # 変換を U1 修飾キーとして使う

    # Simple key replacement
    ###### keymap.replaceKey( "LWin", 235 )
    ###### keymap.replaceKey( "RWin", 255 )

    # User modifier key definition
    ###### keymap.defineModifier( 235, "User0" )

    # 常に有効になるキーリマップ
    keymap_global = keymap.defineWindowKeymap()

    for modifier in ("", "S-", "C-", "A-", "C-S-", "C-A-", "S-A-", "C-A-S-"):

        # keymapの辞書のkey（[]内）に、実際に押下するキーを記述。
        # valueに動作（キー）を代入。

        # 上下左右
        keymap_global[modifier + "U0-H"] = modifier + "Left"
        keymap_global[modifier + "U0-J"] = modifier + "Down"
        keymap_global[modifier + "U0-K"] = modifier + "Up"
        keymap_global[modifier + "U0-L"] = modifier + "Right"
        # Home / End
        keymap_global[modifier + "U0-Comma"] = modifier + "Home"
        keymap_global[modifier + "U0-Period"] = modifier + "End"
        # BackSpace / Delete
        keymap_global[modifier + "U0-N"] = modifier + "Back"  # BackSpace is "Back"
        keymap_global[modifier + "U0-M"] = modifier + "Delete"

        # Enter
        keymap_global[modifier + "U0-Space"] = modifier + "Enter"

        # 数字
        keymap_global[modifier + "U0-Z"] = modifier + "0"
        keymap_global[modifier + "U0-X"] = modifier + "1"
        keymap_global[modifier + "U0-C"] = modifier + "2"
        keymap_global[modifier + "U0-V"] = modifier + "3"
        keymap_global[modifier + "U0-S"] = modifier + "4"
        keymap_global[modifier + "U0-D"] = modifier + "5"
        keymap_global[modifier + "U0-F"] = modifier + "6"
        keymap_global[modifier + "U0-W"] = modifier + "7"
        keymap_global[modifier + "U0-E"] = modifier + "8"
        keymap_global[modifier + "U0-R"] = modifier + "9"

        # 記号
        keymap_global[modifier + "U0-Plus"] = modifier + "S-8"
        keymap_global[modifier + "U0-Asterisk"] = modifier + "S-9"
        keymap_global[modifier + "U0-Y"] = modifier + "Minus"
        

        # エスケープ（無変換を押しながら変換を押したとき）
        keymap_global[modifier + "U0-236"] = "Escape"
    
    # 変換キーでimeをオン、無変換キーでimeをオフ
    # https://koonies.hatenadiary.org/entry/20110818/keyhac_double_key_ime
    keymap_global["O-235"] = lambda : keymap.wnd.setImeStatus(0)  # IMEをOFFにする
    keymap_global["O-236"] = lambda : keymap.wnd.setImeStatus(1)  # IMEのONにする
```