diff --git a/main.go b/main.go index d38be40..215bb79 100644 --- a/main.go +++ b/main.go @@ -37,10 +37,11 @@ func main() { Text: "Toggle Indicator", OnClicked: func() { + // a value of 1024 activates the overlay, a value of 0 deactivates it. Other values seem to deactivate it as well but you never know if indicatorStatus == 1024 { setKey(0) } else { - setKey(1) + setKey(1024) } getKey() indicatorTextLabel.SetText(indicatorStatusString) diff --git a/reg.go b/reg.go index ae944fc..c8c73df 100644 --- a/reg.go +++ b/reg.go @@ -7,7 +7,7 @@ import ( func getKey() { key, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.QUERY_VALUE) if err != nil { - indicatorStatusString = "Error: DLSS not supported!" + indicatorStatusString = "Error: DLSS not supported or registry path not accessible" return } value, _, _ := key.GetIntegerValue("ShowDlssIndicator") @@ -26,6 +26,6 @@ func getKey() { func setKey(value int) { key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.SET_VALUE) - key.SetDWordValue("ShowDlssIndicator", uint32(value * 1024)) + key.SetDWordValue("ShowDlssIndicator", uint32(value)) defer key.Close() -} \ No newline at end of file +}