From 453593bbd28b4aaab30a03743a38881d9e075932 Mon Sep 17 00:00:00 2001 From: Clive Galway Date: Tue, 21 Mar 2023 15:20:12 +0000 Subject: [PATCH] Add options --- v2/Monitor.ahk | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/v2/Monitor.ahk b/v2/Monitor.ahk index 731b55e..b336408 100644 --- a/v2/Monitor.ahk +++ b/v2/Monitor.ahk @@ -91,18 +91,19 @@ Loop 2 { lowest += 2 * MarginY ; Options -; Gui, Add, CheckBox, % "x" columnX.K " y" lowest " hwndhCbFilterPress", Only show key releases -; fn := Func("FilterPress") -; GuiControl, +g, % hCbFilterPress, % fn +chkFilterPress := monitorGui.Add("CheckBox", "x" columnX["K"] " y" lowest, "Only show key releases") +chkFilterPress.OnEvent("Click", FilterPress) -; Gui, Add, CheckBox, % "x" columnX.M " w" totalWidths[devType] " yp hwndhCbFilterMove Checked", Filter Movement (Warning: Turning off can cause crashes) -; fn := Func("FilterMove") -; GuiControl, +g, % hCbFilterMove, % fn +chkFilterMove := monitorGui.Add("CheckBox", "x" columnX["M"] " w" totalWidths[devType] " yp Checked", "Filter Movement (Warning: Turning off can cause crashes)") +chkFilterMove.OnEvent("Click", FilterMove) lowest += 2 * MarginY -; Gui, Add, Button, % "x" columnX.K " y" lowest " w" totalWidths.K " Center gClearKeyboard", Clear -; Gui, Add, Button, % "x" columnX.M " yp w" totalWidths.M " gClearMouse Center", Clear +btnClearKeyboard := monitorGui.Add("Button", "x" columnX["K"] " y" lowest " w" totalWidths["K"] " Center", "Clear") +btnClearKeyboard.OnEvent("Click", ClearKeyboard) + +btnClearMouse := monitorGui.Add("Button", "x" columnX["M"] " yp w" totalWidths["M"] " Center", "Clear") +btnClearMouse.OnEvent("Click", ClearMouse) lowest += 30 @@ -173,31 +174,26 @@ CheckboxChanged(id, ctrl, info){ } } } -/* -FilterMove(hwnd){ +FilterMove(ctrl, info){ global filterMouseMove - GuiControlGet, state, , % hwnd - filterMouseMove := state + filterMouseMove := ctrl.Value } -FilterPress(hwnd){ +FilterPress(ctrl, info){ global filterKeyPress - GuiControlGet, state, , % hwnd - filterKeyPress := state + filterKeyPress := ctrl.Value } -ClearKeyboard: - Gui, ListView, % hLvKeyboard - LV_Delete() - return - -ClearMouse: - Gui, ListView, % hLvMouse - LV_Delete() - return +ClearKeyboard(ctrl, info){ + ; Gui, ListView, % hLvKeyboard + ; LV_Delete() +} -*/ +ClearMouse(ctrl, info){ + ; Gui, ListView, % hLvMouse + ; LV_Delete() +} FormatHex(num){ return Format("{:04X}", num)