Skip to content

Commit

Permalink
Cast control to number if numeric & unset ctrl if falsy for v2.
Browse files Browse the repository at this point in the history
  • Loading branch information
EtorixDev committed Oct 28, 2024
1 parent 7cffbd6 commit 9507775
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ahk/templates/daemon-v2.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,7 @@ AHKWindowList(args*) {
AHKControlClick(args*) {
{% block AHKControlClick %}

ctrl := args[1]
ctrl := IsNumber(args[1]) ? Number(args[1]) : args[1]
title := args[2]
text := args[3]
button := args[4]
Expand All @@ -2368,7 +2368,7 @@ AHKControlClick(args*) {
}

try {
ControlClick(ctrl, title, text, button, click_count, options, exclude_title, exclude_text)
ControlClick(ctrl || unset, title, text, button, click_count, options, exclude_title, exclude_text)
}
finally {
DetectHiddenWindows(current_detect_hw)
Expand All @@ -2383,7 +2383,7 @@ AHKControlClick(args*) {
AHKControlGetText(args*) {
{% block AHKControlGetText %}

ctrl := args[1]
ctrl := IsNumber(args[1]) ? Number(args[1]) : args[1]
title := args[2]
text := args[3]
extitle := args[4]
Expand Down Expand Up @@ -2423,7 +2423,7 @@ AHKControlGetText(args*) {
AHKControlGetPos(args*) {
{% block AHKControlGetPos %}

ctrl := args[1]
ctrl := IsNumber(args[1]) ? Number(args[1]) : args[1]
title := args[2]
text := args[3]
extitle := args[4]
Expand Down Expand Up @@ -2462,7 +2462,7 @@ AHKControlGetPos(args*) {

AHKControlSend(args*) {
{% block AHKControlSend %}
ctrl := args[1]
ctrl := IsNumber(args[1]) ? Number(args[1]) : args[1]
keys := args[2]
title := args[3]
text := args[4]
Expand All @@ -2487,11 +2487,7 @@ AHKControlSend(args*) {
}

try {
if (ctrl != "") {
ControlSend(keys, ctrl, title, text, extitle, extext)
} else {
ControlSend(keys,, title, text, extitle, extext)
}
ControlSend(keys, ctrl || unset, title, text, extitle, extext)
}
finally {
DetectHiddenWindows(current_detect_hw)
Expand Down

0 comments on commit 9507775

Please sign in to comment.