Skip to content

Commit

Permalink
增加显示当前激活的窗体所在应用路径的功能 v1.27
Browse files Browse the repository at this point in the history
  • Loading branch information
pattazl committed Dec 10, 2023
1 parent e19ef41 commit 43bfb48
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 18 deletions.
9 changes: 8 additions & 1 deletion build/release/httpdist/dist/showKeyBoard.desc.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ statProcInfo = 1
; 是否发送按键对应的进程信息,可用于统计不同进程下的按键数
defaultLang = zh-CN
; 默认语言
activeAppShow = 0
; 是否显示当前激活的窗体所在应用路径
[dialog]
guiWidth = 240
; 宽度
Expand Down Expand Up @@ -89,4 +91,9 @@ ctrlTextSize = 20
ctrlList = "Ctrl|Alt|LWin|Shift|RWin|CapsLock"
; 哪些按键长按会显示出来
skipShow = "<^<+a|PrintScreen"
; 哪些按键不会显示,但会记录
; 哪些按键不会显示,但会记录

activeAppShowX = 500
; 应用路径显示的X轴位置
activeAppShowY = 0
; 应用路径显示的Y轴位置
2 changes: 1 addition & 1 deletion build/showKeyBoard.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

; 安装程序初始定义常量
!define PRODUCT_NAME $(ToolLang)
!define PRODUCT_VERSION "v1.26"
!define PRODUCT_VERSION "v1.27"
!define /date DATESTR "%y%m%d"
!define ExeName "showKeyBoard.exe"
!define PRODUCT_PUBLISHER "Austin.Young"
Expand Down
4 changes: 4 additions & 0 deletions common.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ ctrlTextSize :=DescRead("dialog","ctrlTextSize", 20 ) ; 字体大小
ctrlList := StrSplit(DescRead("dialog","ctrlList", "Ctrl|Alt|LWin|Shift|RWin|CapsLock"),"|") ; 哪些按键长按会单独显示出来
skipShow := StrSplit(DescRead("dialog","skipShow", ""),"|") ; 哪些按键不会显示,但会记录

activeAppShow :=DescRead("common","activeAppShow", 0 ) ; 是否显示当前激活的窗体所在应用路径
activeAppShowX :=DescRead("dialog","activeAppShowX", 0 ) ; 应用路径显示的X轴位置
activeAppShowY :=DescRead("dialog","activeAppShowY", 0 ) ; 应用路径显示的Y轴位置

; 部分变量设置
serverUrl := "http://127.0.0.1:" serverPort
; 内部参数
Expand Down
4 changes: 4 additions & 0 deletions dialog.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ GetProcPath(){
ProcPath := 'Unknown'
}
}
; 显示当前激活的应用路径
if( activeAppShow = 1 ){
ToolTip(ProcPath, activeAppShowX, activeAppShowY)
}
return ProcPath
}
; 更新活动窗口信息
Expand Down
2 changes: 1 addition & 1 deletion http/src/records.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async function doCleanData() {
lines = await runExec(db, `INSERT INTO appFreq (keyTime,appPath, keyCount,mouseCount,freqType,date)
with tempApp as (
SELECT keyTime, appPath,keyCount,mouseCount,date FROM appFreq
where freqType = 0 and date between '2023-12-09' and '2023-12-09'
where freqType = 0 and date between ? and ?
)
,tempApp2 as (
SELECT a.*,1.0/b.times as times FROM tempApp a left join ( SELECT keyTime,count(keyTime) as times FROM tempApp group by keyTime ) b
Expand Down
4 changes: 2 additions & 2 deletions http/src/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @version 配置显示在登录页面的前端版本,格式为 v.主版本号.次版本号.日期.小版本序号 v1.0.190827.1
*/
// 对于发布版 YYMMDD 和 verNo 会在Webpack中自动替换为真实的日期和版本序号,如下格式不能随便改,参考vue.config.js的代码
const replaceYYMMDD = '231209';
const replaceVerNo = '1';
const replaceYYMMDD = '231210';
const replaceVerNo = '0';
// 主版本可从 package.json中获取
const mainVersion = '1.27.0';
const strVersion = mainVersion+'.'+replaceYYMMDD+'.'+replaceVerNo; // 可以支持旧版浏览器
Expand Down
1 change: 1 addition & 0 deletions showKeyBoard.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ SendMouse()
PushTxt(GetKeyName(StrReplace(A_ThisHotkey,'~','')),True)
}
}
CoordMode "ToolTip", "Screen"
CoordMode "Mouse", "Screen"
GetDistance(){
MouseGetPos &currentX, &currentY
Expand Down
2 changes: 1 addition & 1 deletion ui-helper/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function ajax(path, data = null) {
// 布尔类型清单,bool list
const boolArr = ['skipCtrlKey', 'recordMouseMove', 'needShowKey', 'needRecordKey', 'ctrlState', 'guiBgTrans',
'guiTrans', 'guiEdge', 'guiDpiscale', 'showHttpDebug', 'hideInWinPwd', 'mergeControl', 'fillDate', 'statProcInfo',
'mergeAppName']
'mergeAppName','activeAppShow']
// 转换字符串为数字或boolean
function str2Type(hash, flag) {
for (let k in hash) {
Expand Down
10 changes: 6 additions & 4 deletions ui-helper/src/components/dataui/Minute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ optAppByMinute.title.top = 0; // 设置标题靠顶部
optAppByMinute.legend.top = 30

let optAppByHour = deepCopy(optByMinute)
optAppByHour.yAxis[1].name = 'Acitved Minutes per Hour',
optAppByHour.series[2].name = 'Acitved Minutes',
optAppByHour.title.top = 0; // 设置标题靠顶部
optAppByHour.yAxis[1].name = 'Actived Minutes per Hour';
optAppByHour.series[2].name = 'Actived Minutes';
optAppByHour.title.top = 0; // 设置标题靠顶部
optAppByHour.legend.top = 30
// 返回Option
function getMinuteOption(typeFlag: Array<MinuteType>): Array<any> {
Expand Down Expand Up @@ -219,6 +219,7 @@ function setChartByMinute(data, charts) {
})
// let base = today.getTime()
//let firstDay = dayjs(firstDate, 'YYYY-MM-DD').valueOf()
lastMinute += oneMinute // 需要增加1单元以便于显示最后一个
let keyData = [], mouseData = [], disData = [];
let afterMinute = 0;// 延后10分钟
let totalMs = lastMinute - firstMinute + afterMinute * 60 * 1000
Expand Down Expand Up @@ -254,6 +255,7 @@ function setChartByHour(data, charts) {
})
// let base = today.getTime()
//let firstDay = dayjs(firstDate, 'YYYY-MM-DD').valueOf()
lastHour += oneHour // 需要增加1单元以便于显示最后一个
let keyData = [], mouseData = [], disData = [];
let totalMs = lastHour - firstHour
let totalHour = totalMs / 1000 / 60 / 60
Expand Down Expand Up @@ -418,7 +420,7 @@ function showAppHour(appName) {
let now = +new Date(firstHour + oneHour * i);
keyData.push([now, hash[now]?.KeyCount ?? 0]);
mouseData.push([now, hash[now]?.MouseCount ?? 0]);
durationData.push([now, hash[now]?.Duration ?? 0]);
durationData.push([now, (hash[now]?.Duration ?? 0).toFixed(2)]);
}
let opt = getMinuteOption([MinuteType.AppByHour])[0]
opt.series[0].data = keyData
Expand Down
16 changes: 16 additions & 0 deletions ui-helper/src/components/setting/Setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
<n-switch :round="false" v-model:value="allConfig.common.statProcInfo" />
</template>
</n-list-item>
<n-list-item>{{ contentText.intro174 }}
<template #suffix>
<n-switch :round="false" v-model:value="allConfig.common.activeAppShow" />
</template>
</n-list-item>
</n-list>
</n-card>
<h2 id="KeyUI">{{ contentText?.menu?.setting2 }}</h2>
Expand Down Expand Up @@ -245,6 +250,17 @@
<n-list-item>{{ contentText.intro55 }}
<n-dynamic-tags v-model:value="skipShowRef" />
</n-list-item>
<h4>{{ contentText.intro174 }}</h4>
<n-list-item>{{ contentText.intro175 }}
<template #suffix>
<n-input-number v-model:value="allConfig.dialog.activeAppShowX" />
</template>
</n-list-item>
<n-list-item>{{ contentText.intro176 }}
<template #suffix>
<n-input-number v-model:value="allConfig.dialog.activeAppShowY" />
</template>
</n-list-item>
</n-list>

</n-card>
Expand Down
18 changes: 12 additions & 6 deletions ui-helper/src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
intro7:'是否显示键盘和鼠标按键',
intro8:'是否记录按键',
intro9:'是否显示控制键状态',
intro10:'控制键主要为 Ctrl,Alt,Shift,Win 出现则显示',
intro10:'控制键主要为 Ctrl,Alt,Shift,Win等,按下则显示',
intro11:'后端服务端口号',
intro12:'按键显示仅针对活跃窗口',
intro13:'使用正则匹配窗口进程名',
Expand Down Expand Up @@ -70,8 +70,8 @@ export default {
intro48:'按键分隔符,用于按键间的显示分割',
intro49:'推荐用空格',
intro50:'长按显示,主要用于控制键,如Ctrl、Alt、LWin、Shift、RWin、CapsLock等',
intro51:'控制键X位置',
intro52:'控制键Y位置',
intro51:'显示控制键X位置',
intro52:'显示控制键Y位置',
intro53:'控制键字体大小',
intro54:'控制键清单',
intro55:'哪些按键不会显示,但会记录',
Expand Down Expand Up @@ -201,6 +201,9 @@ export default {
intro171: '应用操作小时统计',
intro172: '今日数据中,界面操作时N毫秒内界面不刷新,避免影响操作',
intro173: '操作中,?秒后刷新',
intro174: '是否显示当前激活的应用全路径',
intro175: '应用全路径显示的X位置',
intro176: '应用全路径显示的Y位置',

},
'en-US': {
Expand Down Expand Up @@ -233,7 +236,7 @@ export default {
intro7: 'Display mouse and keyboard press',
intro8: 'Record keyboard press',
intro9: 'Display control key status',
intro10: 'Control keys mainly include Ctrl, Alt, Shift, Win (display if they appear)',
intro10: 'Control keys mainly include Ctrl, Alt, Shift, Win (display if pressed)',
intro11: 'Backend service port number',
intro12: 'Keystroke display only for active window',
intro13: 'Use regular expression to match window process names',
Expand Down Expand Up @@ -274,8 +277,8 @@ export default {
intro48: 'Key separator, used for displaying separation between keys',
intro49: 'Recommended to use a space',
intro50: 'Long press display, mainly used for control keys such as Ctrl, Alt, LWin, Shift, RWin, CapsLock, etc.',
intro51: 'Control key X position',
intro52: 'Control key Y position',
intro51: 'Control key Panel X position',
intro52: 'Control key Panel Y position',
intro53: 'Control key font size',
intro54: 'Control key list',
intro55: 'Which keys will not be displayed, but will be recorded',
Expand Down Expand Up @@ -406,5 +409,8 @@ export default {
intro171: 'Apps Operate by hours',
intro172: 'Stop refresh in N ms when click on Today panel, Avoid affecting operations',
intro173: 'In operating, refresh in ? seconds',
intro174: 'Whether show activated App path',
intro175: 'Tooltip of App path X position',
intro176: 'Tooltip of App path Y position',
}
};
4 changes: 2 additions & 2 deletions ui-helper/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @version 配置显示在登录页面的前端版本,格式为 v.主版本号.次版本号.日期.小版本序号 v1.0.190827.1
*/
// 对于发布版 YYMMDD 和 verNo 会在Webpack中自动替换为真实的日期和版本序号,如下格式不能随便改,参考vue.config.js的代码
const replaceYYMMDD = '231209';
const replaceVerNo = '2';
const replaceYYMMDD = '231210';
const replaceVerNo = '4';
const mainVersion = ' v1.27';
const strVersion = mainVersion+'.'+replaceYYMMDD+'.'+replaceVerNo; // 可以支持旧版浏览器
//export default strVersion
Expand Down

0 comments on commit 43bfb48

Please sign in to comment.