From 7f0b63500c8bdbc9b8ec40fdc2e07cd04cab668b Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Fri, 13 Mar 2020 21:27:43 +0100 Subject: [PATCH 1/4] fixed reading booleans from the .ini file When reading a boolean from a .ini file, you have to manually add a step to evaluate what has been read as a _string_ to a boolean. Fun. fixes #3 --- focus.ahk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/focus.ahk b/focus.ahk index 4419c7f..08b7efa 100755 --- a/focus.ahk +++ b/focus.ahk @@ -26,7 +26,7 @@ setWorkingDir %A_ScriptDir% #Persistent ; check for config file and exit if it doesn’t exist -if !FileExist("focus.ini") { +if (!FileExist("focus.ini")) { msgbox, No config file found. Please follow the instructions in the README file. ExitApp, 1 } @@ -43,7 +43,7 @@ readConfig(file) { ; [target] IniRead, tname, % file, target, name - config["target"] := {"name": tname} + config["target","name"] := tname ; [polling] IniRead, prate, % file, polling, pollingrate @@ -74,13 +74,17 @@ readConfig(file) { IniRead, tmp, % file, devices, device%A_Index%useAxes if (tmp == "ERROR") tmp := True + else + tmp := %tmp% useAxes.push(tmp) IniRead, tmp, % file, devices, device%A_Index%useButtons if (tmp == "ERROR") tmp := True + else + tmp := %tmp% useButtons.push(tmp) } - config["devices"] := {"threshold": thold, "names": names, "sensitivities": senses, "useAxes": useAxes, "UseButtons": useButtons} + config["devices"] := {"threshold": thold, "names": names, "sensitivities": senses, "useAxes": useAxes, "useButtons": useButtons} ; [tools] IniRead, tkill, % file, tools, kill @@ -93,7 +97,7 @@ readConfig(file) { else paths.push(tmp) } - config["tools"] := {"kill": tkill, "paths": paths} + config["tools"] := {"kill": %tkill%, "paths": paths} return config } @@ -143,7 +147,7 @@ watchSticks: ; poll all axes for id, dev in config["devices"]["names"] { ; check if axes are enabled for this device - if config["devices"]["useAxes"][id] = True { + if (config["devices"]["useAxes"][id]) { for ia, axis in [ "X", "Y" ] { ; axes are 0-100 ; -50 means we get a deviation from "0" aka resting state @@ -160,7 +164,7 @@ watchSticks: ; check ALL THE BUTTONS! for id, dev in config["devices"]["names"] { ; check if buttons are enabled for this device - if config["devices"]["useButtons"][id] = True { + if (config["devices"]["useButtons"][id]) { ; get button count for the device and loop over all of them buttons := getKeystate(dev "Buttons") Loop, %buttons% From a702de228c1e3307e68e0534c97d0cc10de44d30 Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Fri, 24 Apr 2020 10:23:28 +0200 Subject: [PATCH 2/4] README: fixed Discord invite --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c05dc5b..11b5067 100644 --- a/README.md +++ b/README.md @@ -131,5 +131,5 @@ If you have no idea what I was saying in that last parargraph and / or it doesn’t fix your problem, please [file an issue](https://github.com/alterNERDtive/ahk-joystick-focus/issues). Thanks! :) -You can also [say “Hi” on Discord](https://discord.gg/mD6dAb) if that is your +You can also [say “Hi” on Discord](https://discord.gg/QgEcrvv) if that is your thing. From 53da52d8ae9590e184eaafa4a624d47ac428128f Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Mon, 3 Aug 2020 18:47:45 +0200 Subject: [PATCH 3/4] use `WinClose` instead of `Process, Close` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … since that doesn’t force kill the process. fixes #4 --- focus.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/focus.ahk b/focus.ahk index 08b7efa..40021ec 100755 --- a/focus.ahk +++ b/focus.ahk @@ -133,7 +133,7 @@ watchTarget: for ip, path in config["tools"]["paths"] { SplitPath, path, file if (WinExist("ahk_exe " file)) { - Process, Close, % file + WinClose } } } From 878ff8ac8a3f7ec78896cf3b2e2079985c783c5b Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Mon, 3 Aug 2020 20:08:04 +0200 Subject: [PATCH 4/4] 0.1.1! --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cac4bd1..25cfc25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# v0.2 (2020-08-03) + +## Fixed + +* reading booleans from the .ini file “correctly” (= it works™) (#3) +* no longer force-killing tools on exit, gracefully instead (#4) + +----- + # v0.1 (2020-02-08) Initial release. Currently not working properly with throttle axes; see #1 and