isearch_explore true

keycommand NOMETA, KEY_UP,           "*",        "cursor_up()"
keycommand NOMETA, KEY_DOWN,         "*",        "cursor_down()"
keycommand NOMETA, KEY_LEFT,         "*",        "move_left_directory()"
keycommand NOMETA, KEY_RIGHT,        "*",        "move_right_directory()"
keycommand NOMETA, KEY_PAGEUP,       "*",        "pageup()"
keycommand NOMETA, KEY_PAGEDOWN,     "*",        "pagedown()"
keycommand NOMETA, KEY_CTRL_P,       "*",        "cursor_up()"
keycommand NOMETA, KEY_CTRL_N,       "*",        "cursor_down()"
keycommand NOMETA, KEY_CTRL_B,       "*",        "move_left_directory()"
keycommand NOMETA, KEY_CTRL_F,       "*",        "move_right_directory()"
keycommand NOMETA, KEY_CTRL_D,       "*",        "pagedown()"
keycommand NOMETA, KEY_CTRL_U,       "*",        "pageup()"
keycommand NOMETA, KEY_CTRL_A,       "*",        "cursor_top()"
keycommand NOMETA, KEY_CTRL_E,       "*",        "cursor_bottom()"
keycommand NOMETA, KEY_CTRL_H,       "*",        "move_parent_dir()"
keycommand NOMETA, KEY_BACKSPACE,    "*",        "move_parent_dir()"
keycommand META,   KEY_LEFT,         "*",        "move_back()"
keycommand NOMETA, KEY_META_LEFT,    "*",        "move_back()"
keycommand NOMETA, KEY_BACKSLASH,    "*",        "move_root_dir()"
keycommand NOMETA, KEY_TILDA,        "*",        "move_home_dir()"
keycommand NOMETA, KEY_ESCAPE,       "*",        "key_escape()"
keycommand NOMETA, KEY_CTRL_G,       "*",        "key_escape()"

keycommand NOMETA, KEY_SPACE,        "*",        "mark_cursor_file_and_down_cursor()"
keycommand NOMETA, KEY_HOME,         "*",        "mark_all_files(adir())"
keycommand NOMETA, KEY_END,          "*",        "mark_all(adir())"
keycommand NOMETA, KEY_LBRACK,       "*",        "mark_range_begin()"
keycommand NOMETA, KEY_RBRACK,       "*",        "mark_range_end()"

keycommand NOMETA, KEY_CTRL_L,       "*",        "refresh()"
keycommand NOMETA, KEY_QMARK,        "*",        "mfiler2_help()"
#keycommand NOMETA, KEY_ESCAPE,       "*",        "mf_exit()"
keycommand META,   KEY_DOT,          "*",        "toggle_visible_dot_file()"
keycommand NOMETA, KEY_DELETE,       "*",        "throw_mark_or_cursor_file()"
keycommand NOMETA, KEY_CTRL_C,       "*",        "mf_exit()"

keycommand NOMETA, KEY_STAR,         "*",        "menu_mark()"
keycommand NOMETA, KEY_PLUS,         "*",        "menu_mask()"

keycommand NOMETA, KEY_DOLLAR,       "*",        "menu_extra()"
keycommand NOMETA, KEY_COLON,        "*",        "call_shell(false)"

if !msystem("uname -s").index("CYGWIN") 
    keycommand NOMETA, KEY_SHARP,    "*",        "menu_sudo()"
end

keycommand NOMETA, KEY_EXCLAM,       "*",        "run_file_manager()"

keycommand NOMETA, KEY_CTRL_I,       "*",        "goto_2directory_mode()"
keycommand NOMETA, KEY_CTRL_T,       "*",        "stack_current_directory()"
keycommand NOMETA, KEY_CTRL_W,       "*",        "close_current_directory()"

keycommand META, KEY_0,              "*",        "tab_menu_select()"
keycommand META, KEY_1,              "*",        "job_forground(1)"
keycommand META, KEY_2,              "*",        "job_forground(2)"
keycommand META, KEY_3,              "*",        "job_forground(3)"
keycommand META, KEY_4,              "*",        "job_forground(4)"
keycommand META, KEY_5,              "*",        "job_forground(5)"
keycommand META, KEY_6,              "*",        "job_forground(6)"
keycommand META, KEY_7,              "*",        "job_forground(7)"
keycommand META, KEY_8,              "*",        "job_forground(8)"
keycommand META, KEY_9,              "*",        "job_forground(9)"

keycommand NOMETA, KEY_SLASH,        "*",     "isearch_partmatch_toggle()"
keycommand META,   KEY_F,            "*",     "menu_find()"

keycommand META, KEY_c,              "*",     "copy_cursor_or_mark_file()"
keycommand META, KEY_C,              "*",     "menu_copy()"
keycommand META, KEY_m,              "*",     "move_mark_or_cursor_file()"
keycommand META, KEY_M,              "*",     "menu_move()"
keycommand META, KEY_d,              "*",     "throw_mark_or_cursor_file()"
keycommand META, KEY_D,              "*",     "menu_delete()"
keycommand META, KEY_e,              "*",     "edit_cursor_file()"
keycommand META, KEY_E,              "*",     "edit_new_file()"
keycommand META, KEY_v,              "*",     "view_cursor_file()"
keycommand META, KEY_r,              "*",     "rename_cursor_or_mark_file()"
keycommand META, KEY_b,              "*",     "backup_cursor_or_mark_file()"
keycommand META, KEY_p,              "*",     "pack_mark_or_cursor_file()"
keycommand META, KEY_P,              "*",     "pack_mark_or_cursor_file2()"
keycommand META, KEY_k,              "*",     "make_directory()"
keycommand META, KEY_n,              "*",     "make_new_file_cmdline()"
keycommand META, KEY_l,              "*",     "make_link()"
keycommand META, KEY_L,              "*",     "make_link_menu()"
keycommand META, KEY_u,              "*",     "unpack_cursor_file()"
keycommand META, KEY_U,              "*",     "unpack_cursor_file2()"
keycommand META, KEY_K,              "*",     "mmake ENV['EDITOR'], '+'"
keycommand META, KEY_g,              "*",     "mgrep_current_directory()"
keycommand META, KEY_G,              "*",     "menu_grep()"
keycommand META, KEY_i,              "*",     "minfo()"
keycommand META, KEY_a,              "*",     "menu_attr()"
keycommand META, KEY_s,              "*",     "menu_sort()"
keycommand META, KEY_V,              "*",     "menu_view()"
keycommand META, KEY_j,              "*",     "directory_menu"
keycommand META, KEY_J,              "*",     "menu_jump()"
keycommand META, KEY_o,              "*",     "copy_path()"
keycommand META, KEY_O,              "*",     "copy_path2()"
keycommand META, KEY_w,              "*",     "exchange_path()"
keycommand META, KEY_h,              "*",     "goto_cmdline()"
keycommand META, KEY_H,              "*",     "menu_shell()"
keycommand META, KEY_z,              "*",     "toggle_xterm_next()"
keycommand META, KEY_Z,              "*",     "toggle_xterm()"
keycommand META, KEY_q,              "*",     "quit_or_close_directory()"
keycommand META, KEY_x,              "*",     "excute_cursor_or_mark_file()"
keycommand NOMETA, KEY_y,            "*",     "menu_my_commands()"

keycommand NOMETA, KEY_F1,           "*",     "menu_all()"
keycommand NOMETA, KEY_F2,           "*",     "rename_cursor_or_mark_file()"
keycommand NOMETA, KEY_F3,           "*",     "menu_attr()"
keycommand NOMETA, KEY_F4,           "*",     "edit_cursor_file()"
keycommand NOMETA, KEY_F5,           "*",     "copy_cursor_or_mark_file()"
keycommand NOMETA, KEY_F6,           "*",     "move_mark_or_cursor_file()"
keycommand NOMETA, KEY_F7,           "*",     "make_link()"
keycommand NOMETA, KEY_F8,           "*",     "throw_mark_or_cursor_file()"
keycommand NOMETA, KEY_F9,           "*",     "make_directory()"
keycommand NOMETA, KEY_F10,          "*",     "make_new_file_cmdline()"
keycommand NOMETA, KEY_F11,          "*",     "excute_cursor_or_mark_file()"
keycommand NOMETA, KEY_F12,          "*",     "goto_cmdline()"

keycommand META, KEY_f,              "*",     "start_sisearch()"
keycommand META, KEY_F,              "*",     "menu_find()"

keycommand META,   KEY_X,            "*",        "edit_and_load_ruby_script()"

keycommand NOMETA, KEY_ENTER, ".dir",       "enter_directory()"
keycommand NOMETA, KEY_ENTER, ".link",      "enter_link()"
keycommand NOMETA, KEY_ENTER, ".mark",      "enter_mark()"
keycommand NOMETA, KEY_ENTER, ".gz",        "enter_gz()"
keycommand NOMETA, KEY_ENTER, ".tgz",       "enter_tgz()"
keycommand NOMETA, KEY_ENTER, ".bz2",       "enter_bz2()"
keycommand NOMETA, KEY_ENTER, ".zip",       "enter_zip()"
keycommand NOMETA, KEY_ENTER, ".lzh",       "enter_lzh()"

###############################################################################
# 外部プログラムの登録
###############################################################################
if msystem("uname -s").index("CYGWIN")
    if msystem("which cdrop 2> /dev/null") != ""
        keycommand NOMETA, KEY_ATMARK, "*",  "shell('%Q cdrop %m','cdrop')"
    end

    if msystem("which ContextMenu 2> /dev/null") != ""
        keycommand META, KEY_ATMARK, "*",  "key_enter_win_program2('ContextMenu')"
        keycommand META, KEY_ATMARK, ".mark",  "key_enter_mark_win_program2('ContextMenu')"
    end
else
    keycommand NOMETA, KEY_ATMARK, "*", "shell('%Q mdnd %m &', 'mdnd')"
end

