UNPKG

gpii-windows

Version:

Components of the GPII personalization infrastructure for use on Microsoft's "Windows" ™

104 lines (90 loc) 2.97 kB
# Windows System Settings Handler This gets/sets settings using the same back-end used by the Windows System Settings. A [helper application](../../../settingsHelper) is used to perform the actual work. This needs to be performed in a separate process because it must be run as a 64-bit process. ## Payload The payload for this settings handler looks like this: ```json { "settings": { "settingId": { "value": "the-value" }, "another-settingId": { "value": "the-value" } } } ``` The settingId identifies the setting. See [/settingsHelper/README.md](../../../settingsHelper/README.md) about that. Only settings of types `Boolean`, `String`, `List`, `LabeledString`, and `Range` can be altered using this handler. ## Example solution settings block ```json { "settingsHandlers": { "configure": { "type": "gpii.windows.systemSettingsHandler", "capabilities": [ "example.bluelight" ], "capabilitiesTransformations": { "SystemSettings_Display_BlueLight_ManualToggleQuickAction": { "transform": { "type": "fluid.transforms.value", "inputPath": "example.bluelight", "outputPath": "value" } } } } } } ``` ## Quick test, to prove it works Replace the sticky keys solution with this, then login as [vicky](https://github.com/GPII/universal/blob/master/testData/preferences/vicky.json): (this makes the sticky keys preference enable the on screen keyboard) ```javascript "com.microsoft.windows.stickyKeys": { "name": "Windows StickyKeys", "contexts": { "OS": [ { "id": "win32", "version": ">=5.0" } ] }, // this block is the only change "settingsHandlers": { "configure": { "type": "gpii.windows.systemSettingsHandler", "capabilities": [ "http://registry\\.gpii\\.net/common/stickyKeys" ], "capabilitiesTransformations": { "SystemSettings_Accessibility_Keyboard_IsOSKEnabled": { "transform": { "type": "fluid.transforms.value", "inputPath": "http://registry\\.gpii\\.net/common/stickyKeys", "outputPath": "value" } } } } }, "update": [ "configure" ], "configure": [ "settings.configure" ], "restore": [ "settings.configure" ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" } ] }, ```