diff --git a/src/components/SettingsWindow.jsx b/src/components/SettingsWindow.jsx index 19aa1e95..3b79241e 100644 --- a/src/components/SettingsWindow.jsx +++ b/src/components/SettingsWindow.jsx @@ -1651,7 +1651,7 @@ function ActionItem(props) { return null } else { let selectBoxValue = action.target - if (!(selectBoxValue === "brightness" || selectBoxValue === "contrast" || selectBoxValue === "volume" || selectBoxValue === "powerState")) { + if (!(selectBoxValue === "brightness" || selectBoxValue === "sdr" || selectBoxValue === "contrast" || selectBoxValue === "volume" || selectBoxValue === "powerState")) { selectBoxValue = "vcp" } const selectBox = ( @@ -1670,6 +1670,7 @@ function ActionItem(props) { + ) diff --git a/src/electron.js b/src/electron.js index 4a4b8a75..5eb5b448 100644 --- a/src/electron.js +++ b/src/electron.js @@ -1116,6 +1116,8 @@ async function doHotkey(hotkey) { let currentValue = 0 if (action.target === "brightness") { currentValue = monitor.brightness + } else if (action.target === "sdr") { + currentValue = monitor.sdrLevel ?? 0 } else if (action.target === "contrast") { currentValue = await getVCP(monitor, parseInt("0x12")) } else if (action.target === "volume") { @@ -1136,6 +1138,8 @@ async function doHotkey(hotkey) { let currentCycleValue = 0 if (action.target === "brightness") { currentCycleValue = monitor.brightness + } else if (action.target === "sdr") { + currentCycleValue = monitor.sdrLevel ?? 0 } else if (action.target === "contrast") { currentCycleValue = await getVCP(monitor, parseInt("0x12")) } else if (action.target === "volume") { @@ -1196,6 +1200,8 @@ async function doHotkey(hotkey) { writeSettings({ linkedLevelsActive: false }) } showOverlay = true + } else if(action.target === "sdr") { + updateBrightnessThrottle(monitor.id, parseInt(value), false, true, "sdr") } else { let vcpCode = action.target if (action.target === "contrast") { @@ -1933,6 +1939,7 @@ function updateBrightness(index, newLevel, useCap = true, vcpValue = "brightness brightness: level, id: monitor.id }) + monitor.sdrLevel = level } else if (monitor.type == "ddcci") { if (vcp === "brightness") { monitor.brightness = level diff --git a/src/localization/en.json b/src/localization/en.json index 5100c510..70ff6208 100644 --- a/src/localization/en.json +++ b/src/localization/en.json @@ -139,6 +139,7 @@ "SETTINGS_FEATURES_VCP_LIST_TITLE": "All VCP codes reported by this display", "SETTINGS_FEATURES_VCP_LIST_DESC": "The following is a list of available VCP codes reported by this display to Windows. Twinkle Tray does not validate the functionality or stability of these VCP codes. Use them at your own risk.", "SETTINGS_FEATURES_VCP_EXPECTED": "Expected values", + "SETTINGS_FEATURES_SDR_BRIGHTNESS": "SDR Brightness", "SETTINGS_TIME_TITLE": "Time of Day Adjustments", "SETTINGS_TIME_DESC": "Automatically set your monitors to a specific brightness level at a desired time. All monitors will be set to the same, normalized levels.", "SETTINGS_TIME_ADD": "Add a time",