Skip to content

Commit

Permalink
默认启用ESC清除功能
Browse files Browse the repository at this point in the history
  • Loading branch information
zedeeee committed Aug 21, 2024
1 parent 054c47c commit 030c05f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 9 additions & 5 deletions Lib/tray_menu.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ modify_shortcut_cb(*)

about_cb(*)
{
arr := StrSplit(menu_items[1][1], "v")
arr := StrSplit(menu_items[1][1], " ")
version := arr[arr.Length]
MsgBox Format("一个CATIA快捷键脚本`n使CATIA的操作体验更接近AutoCAD`n版本:{1}", version), "UCLC", 0x40

Expand Down Expand Up @@ -64,6 +64,9 @@ menu_toggleCheck_cb(ItemName, ItemPos, MyMenu)
MyMenu.ToggleCheck(ItemName)
}

Nothing_cb(*) {
; Do Nothing
}

NoAction_cb(*) {
; Do Nothing
Expand All @@ -88,18 +91,19 @@ about_and_updates_menu := [
["关于", about_cb, ""],
["项目主页", showProjectHomepage_cb, ""],
["自定义帮助", help_Homepage_cb, ""],
; ["检查更新", NoAction_cb, ""]
["检查更新", NoAction_cb, ""]
]

dev_sub_menu := [
["ESC增强", esc_enhanced_cb, ""],
; ["ESC增强", esc_enhanced_cb, ""],
["None", Nothing_cb, ""],
]

/**
* ["按钮名称", 回调函数, 子菜单数组]
*/
menu_items := [
["UCLC v2.4.0", NoAction_cb, about_and_updates_menu],
["UCLC v2.4.2-dev", NoAction_cb, about_and_updates_menu],
["", NoAction_cb, ""],
["自定义别名", modify_alias_cb, ""],
["自定义快捷键", modify_shortcut_cb, ""],
Expand Down Expand Up @@ -154,5 +158,5 @@ add_coustom_tray_menu()
A_TrayMenu.Add(button_name, callback_function)

}
A_TrayMenu.Rename(menu_items[1][1], "UCLC")
; A_TrayMenu.Rename(menu_items[1][1], "UCLC")
}
5 changes: 0 additions & 5 deletions UCLC.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ global hotkey_ini_path := GET_USER_CONFIG_INI_PATH("快捷键")
global DEBUG_I := IniRead(config_ini_path, "通用", "DEBUG")
global workbench_list := Map()
global current_workbench := ""
; global ESC_CLEAN_FUNC_ENABLE_FLAG := ""

; 检查 USER-CONFIG文件
check_user_config()

; ESC_CLEAN_FUNC_ENABLE_FLAG := init_dev_func_prompt(config_ini_path, "ESC_CLEAN", "ESC 键清除 POWER-INPUT (CATIA 有崩溃风险)")

; 创建 计算器 组
GroupAdd "group_calc", "计算器"
GroupAdd "group_calc", "Calculator"
Expand Down Expand Up @@ -251,9 +248,7 @@ loop {
; 清除 CATIA power-input 输入框里的内容
~Esc::
{
if ESC_CLEAN_FUNC_ENABLE_FLAG == 1 {
ControlSetText("", get_power_input_edit_hwnd())
}
}

}

0 comments on commit 030c05f

Please sign in to comment.