Skip to content

Commit

Permalink
解决当桌面没有窗体时可能选中按键提示的文本 v1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
pattazl committed Oct 23, 2023
1 parent c3d0e5b commit bd4f813
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
27 changes: 26 additions & 1 deletion dialog.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ ShowTxt(text)
}
textArr.push(text)
newText := Trim(GetKeyText(textArr)) ; 去掉首尾空格
editType := "Edit" ; 默认用edit类型可以滚动,但有边框需要额外去掉
editType := "Edit" ; Text Edit 默认用edit类型可以滚动,但有边框需要额外去掉
; 重新创建新的对象,便于计算新的高度,旧对象删除即可
MyEdit:= MyGui.Add(editType, editOpt ,newText) ; Edit Text
; 不允许获取焦点,如果获得焦点立刻释放
MyEdit.OnEvent("Focus", Edit_Focus)
; 去掉默认细边框
if guiEdge =0 {
WinSetExStyle "-0x00000200", MyEdit
Expand Down Expand Up @@ -122,6 +124,29 @@ ShowTxt(text)
ReLayOut(guiX,guiY,guiWidth,editHeight)
global guiShowing := 0
}
; 如果edit获得焦点,需要立刻去掉
Edit_Focus(thisEdit,Info) { ; Declaring this parameter is optional.
; OutputDebug ("AutoHotkey myGui_Focus" )
SendMessage 0x0008, 0, 0, thisEdit ; EM_SETSEL = 0x00B1, WM_KILLFOCUS =0x0008 系统会自动触发选中,取消焦点防止选中
}

; OnMessage(0x00B1, WM_LBUTTONDOWN) ; EM_SETSEL 消息无法通过OnMessage捕获
; OnMessage(0x0201, WM_LBUTTONDOWN)
; WM_LBUTTONDOWN(wParam, lParam, msg, hwnd)
; {
; OutputDebug ("AutoHotkey WM_LBUTTONDOWN" )
; X := lParam & 0xFFFF
; Y := lParam >> 16
; Control := ""
; thisGui := GuiFromHwnd(hwnd)
; thisGuiControl := GuiCtrlFromHwnd(hwnd)
; if thisGuiControl
; {
; thisGui := thisGuiControl.Gui
; Control := "`n(in control " . thisGuiControl.ClassNN . ")"
; }
; ToolTip "You left-clicked in Gui window '" thisGui.Title "' at client coordinates " X "x" Y "." Control
; }

; 清理无需的窗口
CloseSelf()
Expand Down
2 changes: 1 addition & 1 deletion http/src/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @version 配置显示在登录页面的前端版本,格式为 v.主版本号.次版本号.日期.小版本序号 v1.0.190827.1
*/
// 对于发布版 YYMMDD 和 verNo 会在Webpack中自动替换为真实的日期和版本序号,如下格式不能随便改,参考vue.config.js的代码
const replaceYYMMDD = '231015';
const replaceYYMMDD = '231021';
const replaceVerNo = '0';
// 主版本从 package.json中获取
const mainVersion = '1.0';
Expand Down
6 changes: 3 additions & 3 deletions showKeyBoard.ahk
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
;编译信息
;@Ahk2Exe-SetName ShowKeyBoard
;@Ahk2Exe-SetDescription Show and Analyse Mouse/KeyBoard
;@Ahk2Exe-SetProductVersion 1.11.0.0
;@Ahk2Exe-SetFileVersion 1.11.0.0
;@Ahk2Exe-SetProductVersion 1.12.0.0
;@Ahk2Exe-SetFileVersion 1.12.0.0
;@Ahk2Exe-SetCopyright Austing.Young (2023 - )
;@Ahk2Exe-SetMainIcon res\keyboard.ico
#Requires AutoHotkey v2
#SingleInstance Ignore
global APPName:="ShowKeyBoard", ver:="1.11"
global APPName:="ShowKeyBoard", ver:="1.12"
#include "common.ahk"
#Include events.ahk
; 正式代码开始
Expand Down

0 comments on commit bd4f813

Please sign in to comment.