Merge branch 'main' into edp-cpw-changes-9673486

This commit is contained in:
Meghan Stewart 2025-01-15 06:11:43 -08:00 committed by GitHub
commit bb400e436b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 2029 additions and 10 deletions

View File

@ -6,7 +6,7 @@ Anyone who is interested can contribute to the topics. When you contribute, your
### Quickly update an article using GitHub.com
Contributors who only make infrequent or small updates can edit the file directly on GitHub.com without having to install any additional software. This article shows you how. [This two-minute video](https://www.microsoft.com/videoplayer/embed/RE1XQTG) also covers how to contribute.
Contributors who only make infrequent or small updates can edit the file directly on GitHub.com without having to install any additional software. This article shows you how. [This two-minute video](https://learn-video.azurefd.net/vod/player?id=b5167c5a-9c69-499b-99ac-e5467882bc92) also covers how to contribute.
1. Make sure you're signed in to GitHub.com with your GitHub account.
2. Browse to the page you want to edit on Microsoft Learn.

View File

@ -54,7 +54,7 @@ To create supplemental policies, download and install the [WDAC Policy Wizard][E
The following video provides an overview and explains how to create supplemental policies for apps blocked by the Windows 11 SE base policy.
> [!VIDEO https://www.microsoft.com/en-us/videoplayer/embed/RWWReO]
> [!VIDEO https://learn-video.azurefd.net/vod/player?id=1eedb284-5592-43e7-9446-ce178953502d]
### Create a supplemental policy for Win32 apps

View File

@ -0,0 +1,8 @@
---
author: TerryWarwick
ms.author: twarwick
ms-topic: include
ms.date: 09/30/2024
---
**Supported Editions** </br> ✅ IoT Enterprise LTSC</br>✅ IoT Enterprise</br>✅ Enterprise LTSC</br>✅ Enterprise</br>✅ Education

View File

@ -0,0 +1,76 @@
---
title: Disable all blocked key combinations
description: Disable all blocked key combinations
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# Disable all blocked key combinations
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
The following sample Windows PowerShell script uses the WMI providers to disable all blocked key combinations for Keyboard Filter by using the Windows Management Instrumentation (WMI) providers for Keyboard Filter. The key combination configurations aren't removed, but Keyboard Filter stops blocking any keys.
## Disable-all-rules.ps1
```powershell
#
# Copyright (C) Microsoft. All rights reserved.
#
<#
.Synopsis
This Windows PowerShell script shows how to enumerate all existing keyboard filter
rules and how to disable them by setting the Enabled property directly.
.Description
For each instance of WEKF_PredefinedKey, WEKF_CustomKey, and WEKF_Scancode,
set the Enabled property to false/0 to disable the filter rule, thus
allowing all key sequences through the filter.
.Parameter ComputerName
Optional parameter to specify the remote computer that this script should
manage. If not specified, the script will execute all WMI operations
locally.
#>
param(
[String]$ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"}
$CommonParams += $PSBoundParameters
Get-WMIObject -class WEKF_PredefinedKey @CommonParams |
foreach {
if ($_.Enabled) {
$_.Enabled = 0;
$_.Put() | Out-Null;
Write-Host Disabled $_.Id
}
}
Get-WMIObject -class WEKF_CustomKey @CommonParams |
foreach {
if ($_.Enabled) {
$_.Enabled = 0;
$_.Put() | Out-Null;
Write-Host Disabled $_.Id
}
}
Get-WMIObject -class WEKF_Scancode @CommonParams |
foreach {
if ($_.Enabled) {
$_.Enabled = 0;
$_.Put() | Out-Null;
"Disabled {0}+{1:X4}" -f $_.Modifiers,$_.Scancode
}
}
```
## Related articles
- [Windows PowerShell script samples for keyboard filter](keyboardfilter-powershell-script-samples.md)
- [Keyboard filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
- [Keyboard filter](index.md)

View File

@ -0,0 +1,146 @@
---
title: Keyboard Filter
description: Keyboard Filter
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: overview
---
# Keyboard Filter
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
You can use Keyboard Filter to suppress undesirable key presses or key combinations. Normally, a customer can use certain Microsoft Windows key combinations like Ctrl+Alt+Delete or Ctrl+Shift+Tab to alter the operation of a device by locking the screen or using Task Manager to close a running application. This behavior might not be desirable if your device is intended for a dedicated purpose.
The Keyboard Filter feature works with physical keyboards, the Windows on-screen keyboard, and the touch keyboard. Switching from one language to another might cause the location of suppressed keys on the keyboard layout to change. Keyboard Filter detects these dynamic layout changes and continues to suppress keys correctly.
> [!NOTE]
> Keyboard filter is not supported in a remote desktop session.
## Terminology
- **Turn on, enable:** Make the setting available to the device and optionally apply the settings to the device. Generally *turn on* is used in the user interface or control panel, whereas *enable* is used for command line
- **Configure:** To customize the setting or subsettings
- **Embedded Keyboard Filter:** This feature is called Embedded Keyboard Filter in Windows 10, version 1511
- **Keyboard Filter:** This feature is called Keyboard Filter in Windows 10, version 1607 and later
## Turn on Keyboard Filter
By default, Keyboard Filter isn't turned on. You can turn Keyboard Filter on or off for your device by using the following steps.
Turning on an off Keyboard Filter requires that you restart your device. Keyboard Filter is automatically enabled after the restart.
### Turn on Keyboard Filter by using Control Panel
1. In the Windows search bar, type **Turn Windows features on or off** and either press **Enter** or tap or select **Turn Windows features on or off** to open the **Windows Features** window.
1. In the **Windows Features** window, expand the **Device Lockdown** node, and select (to turn on) or clear (to turn off) the checkbox for **Keyboard Filter**.
1. Select **OK**. The **Windows Features** window indicates that Windows is searching for required files and displays a progress bar. Once found, the window indicates that Windows is applying the changes. When completed, the window indicates the requested changes are completed.
1. Restart your device to apply the changes.
### Configure Keyboard using Unattend
1. You can configure the Unattend settings in the [Microsoft-Windows-Embedded-KeyboardFilterService](/windows-hardware/customize/desktop/unattend/microsoft-windows-embedded-keyboardfilterservice) component to add Keyboard Filter features to your image during the design or imaging phase.
1. You can manually create an Unattend answer file or use Windows System Image Manager (Windows SIM) to add the appropriate settings to your answer file. For more information about the keyboard filter settings and XML examples, see the settings in [Microsoft-Windows-Embedded-KeyboardFilterService](/windows-hardware/customize/desktop/unattend/microsoft-windows-embedded-keyboardfilterservice).
### Turn on and configure Keyboard Filter using Windows Configuration Designer
The Keyboard Filter settings are also available as Windows provisioning settings so you can configure these settings to be applied during the image deployment time or runtime. You can set one or all keyboard filter settings by creating a provisioning package using Windows Configuration Designer and then applying the provisioning package during image deployment time or runtime.
1. Build a provisioning package in Windows Configuration Designer by following the instructions in [Create a provisioning package](/windows/configuration/provisioning-packages/provisioning-create-package), selecting the **Advanced Provisioning** option.
> [!Note]
> In the **Choose which settings to view and configure** window, choose **Common to all Windows desktop editions**.
1. On the **Available customizations** page, select **Runtime settings** &gt; **SMISettings**, and then set the desired values for the keyboard filter settings.
1. Once you have finished configuring the settings and building the provisioning package, you can apply the package to the image deployment time or runtime. For more information, see [Apply a provisioning package](/windows/configuration/provisioning-packages/provisioning-apply-package).
This example uses a Windows image called install.wim, but you can use the same procedure to apply a provisioning package. For more information on DISM, see [What Is Deployment Image Servicing and Management](/windows-hardware/manufacture/desktop/what-is-dism).
### Turn on and configure Keyboard Filter by using DISM
1. Open a command prompt with administrator privileges.
1. Enable the feature using the following command.
```cmd
Dism /online /Enable-Feature /FeatureName:Client-KeyboardFilter
```
1. Once the script completes, restart the device to apply the change.
## Keyboard Filter features
Keyboard Filter has the following features:
- Supports hardware keyboards, the standard Windows on-screen keyboard, and the touch keyboard (TabTip.exe)
- Suppresses key combinations even when they come from multiple keyboards
For example, if a user presses the Ctrl key and the Alt key on a hardware keyboard, while at the same time pressing Delete on a software keyboard, Keyboard Filter can still detect and suppress the Ctrl+Alt+Delete functionality.
- Supports numeric keypads and keys designed to access media player and browser functionality
- Can configure a key to breakout of a locked down user session to return to the Welcome screen
- Automatically handles dynamic layout changes
- Can be enabled or disabled for administrator accounts
- Can force disabling of Ease of Access functionality
- Supports x86 and x64 architectures
## Keyboard scan codes and layouts
When a key is pressed on a physical keyboard, the keyboard sends a scan code to the keyboard driver. The driver then sends the scan code to the OS and the OS converts the scan code into a virtual key based on the current active layout. The layout defines the mapping of keys on the physical keyboard, and has many variants. A key on a keyboard always sends the same scan code when pressed, however this scan code can map to different virtual keys for different layouts. For example, in the English (United States) keyboard layout, the key to the right of the P key maps to `{`. However, in the Swedish (Sweden) keyboard layout, the same key maps to `Å`.
Keyboard Filter can block keys either by the scan code or the virtual key. Blocking keys by the scan code is useful for custom keyboards that have special scan codes that don't translate into any single virtual key. Blocking keys by the virtual key is more convenient because it's easier to read and Keyboard Filter suppresses the key correctly even when the location of the key changes because of a layout change.
When you configure Keyboard Filter to block keys by using the virtual key, you must use the English names for the virtual keys. For more information about the names of the virtual keys, see keyboard filter key names.
For the Windows on-screen keyboard, keyboard filter converts each keystroke into a scan code based on the layout, and back into a virtual key. This allows keyboard filter to suppress the on-screen keyboard keys in the same manner as physical keyboard keys if they're configured with either scan code or virtual key.
## Keyboard Filter and ease of access features
By default, ease of access features are enabled and Keyboard Filter is disabled for administrator accounts.
If Sticky Keys are enabled, a user can bypass Keyboard Filter in certain situations. You can configure keyboard filter to disable all ease of access features and prevent users from enabling them.
You can enable ease of access features for administrator accounts, while still disabling them for standard user accounts, by making sure that Keyboard Filter is disabled for administrator accounts.
## Keyboard Filter configuration
You can configure the following options for Keyboard Filter:
- Set/unset predefined key combinations to be suppressed
- Add/remove custom defined key combinations to be suppressed
- Enable/disable keyboard filter for administrator accounts
- Force disabling ease of access features
- Configure a breakout key sequence to break out of a locked down account
Most configuration changes take effect immediately. Some changes, such as enabling or disabling Keyboard Filter for administrators, don't take effect until the user signs out of the account and then back in. If you change the breakout key scan code, you must restart the device before the change take effect.
You can configure keyboard filter by using Windows Management Instrumentation (WMI) providers. You can use the Keyboard Filter WMI providers directly in a PowerShell script or in an application.
For more information about Keyboard Filter WMI providers, see [Keyboard Filter WMI provider reference](keyboardfilter-wmi-provider-reference.md).
## Keyboard breakout
You may need to sign in to a locked down device with a different account in order to service or configure the device. You can configure a breakout key to break out of a locked down account by specifying a key scan code. A user can press this key consecutively five times to switch to the Welcome screen so that you can sign in to a different account.
The breakout key is set to the scan code for the left Windows logo key by default. You can use the [WEKF_Settings](wekf-settings.md) WMI class to change the breakout key scan code. If you change the breakout key scan code, you must restart the device before the change takes effect.
## Keyboard Filter considerations
Starting a device in Safe Mode bypasses keyboard filter. The Keyboard Filter service isn't loaded in Safe Mode, and keys aren't blocked in Safe Mode.
Keyboard filter can't block the Sleep key.
Some hardware keys, such as rotation lock, don't have a defined virtual key. You can still block these keys by using the scan code of the key.
The add (+), multiply (\*), subtract (-), divide (/), and decimal (.) keys have different virtual keys and scan codes on the numeric keypad than on the main keyboard. You must block both keys to block these keys. For example, to block the multiply key, you must add a rule to block "\*" and a rule to block Multiply.
When locking the screen by using the on-screen keyboard, or a combination of a physical keyboard and the on-screen keyboard, the on-screen keyboard sends an extra Windows logo key keystroke to the OS. If your device is using the Windows 10 shell and you use keyboard filter to block Windows logo key+L, the extra Windows logo key keystroke causes the shell to switch between the **Start** screen and the last active app when a user attempts to lock the device by using the on-screen keyboard, which may be unexpected behavior.
Some custom keyboard software, such as Microsoft IntelliType Pro, can install Keyboard Filter drivers that prevent Keyboard Filter from being able to block some or all keys, typically extended keys like BrowserHome and Search.
## In this section
- [Keyboard Filter key names](keyboardfilter-key-names.md)
- [Predefined key combinations](predefined-key-combinations.md)
- [Keyboard Filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
- [Windows PowerShell script samples for Keyboard Filter](keyboardfilter-powershell-script-samples.md)

View File

@ -0,0 +1,163 @@
---
title: Add blocked key combinations
description: Add blocked key combinations
ms.assetid: f51892fc-0262-4b25-b117-6e131b86fb68
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# Add blocked key combinations
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
The following sample Windows PowerShell script uses the Windows Management Instrumentation (WMI) providers for Keyboard Filter to create three functions to configure Keyboard Filter so that Keyboard Filter blocks key combinations. It demonstrates several ways to use each function.
The first function, `Enable-Predefine-Key`, blocks key combinations that are predefined for Keyboard Filter.
The second function, `Enable-Custom-Key`, blocks custom key combinations by using the English key names.
The third function, `Enable-Scancode`, blocks custom key combinations by using the keyboard scan code for the key.
## Enable-rules.ps1
```powershell
#
# Copyright (C) Microsoft. All rights reserved.
#
<#
.Synopsis
This script shows how to use the built in WMI providers to enable and add
keyboard filter rules through Windows PowerShell on the local computer.
.Parameter ComputerName
Optional parameter to specify a remote machine that this script should
manage. If not specified, the script will execute all WMI operations
locally.
#>
param (
[String] $ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"}
$CommonParams += $PSBoundParameters
function Enable-Predefined-Key($Id) {
<#
.Synopsis
Toggle on a Predefined Key keyboard filter Rule
.Description
Use Get-WMIObject to enumerate all WEKF_PredefinedKey instances,
filter against key value "Id", and set that instance's "Enabled"
property to 1/true.
.Example
Enable-Predefined-Key "Ctrl+Alt+Del"
Enable CAD filtering
#>
$predefined = Get-WMIObject -class WEKF_PredefinedKey @CommonParams |
where {
$_.Id -eq "$Id"
};
if ($predefined) {
$predefined.Enabled = 1;
$predefined.Put() | Out-Null;
Write-Host Enabled $Id
} else {
Write-Error "$Id is not a valid predefined key"
}
}
function Enable-Custom-Key($Id) {
<#
.Synopsis
Toggle on a Custom Key keyboard filter Rule
.Description
Use Get-WMIObject to enumerate all WEKF_CustomKey instances,
filter against key value "Id", and set that instance's "Enabled"
property to 1/true.
In the case that the Custom instance does not exist, add a new
instance of WEKF_CustomKey using Set-WMIInstance.
.Example
Enable-Custom-Key "Ctrl+V"
Enable filtering of the Ctrl + V sequence.
#>
$custom = Get-WMIObject -class WEKF_CustomKey @CommonParams |
where {
$_.Id -eq "$Id"
};
if ($custom) {
# Rule exists. Just enable it.
$custom.Enabled = 1;
$custom.Put() | Out-Null;
"Enabled Custom Filter $Id.";
} else {
Set-WMIInstance `
-class WEKF_CustomKey `
-argument @{Id="$Id"} `
@CommonParams | Out-Null
"Added Custom Filter $Id.";
}
}
function Enable-Scancode($Modifiers, [int]$Code) {
<#
.Synopsis
Toggle on a Scancode keyboard filter Rule
.Description
Use Get-WMIObject to enumerate all WEKF_Scancode instances,
filter against key values of "Modifiers" and "Scancode", and set
that instance's "Enabled" property to 1/true.
In the case that the Scancode instance does not exist, add a new
instance of WEKF_Scancode using Set-WMIInstance.
.Example
Enable-Scancode "Ctrl" 37
Enable filtering of the Ctrl + keyboard scancode 37 (base-10)
sequence.
#>
$scancode =
Get-WMIObject -class WEKF_Scancode @CommonParams |
where {
($_.Modifiers -eq $Modifiers) -and ($_.Scancode -eq $Code)
}
if($scancode) {
$scancode.Enabled = 1
$scancode.Put() | Out-Null
"Enabled Custom Scancode {0}+{1:X4}" -f $Modifiers, $Code
} else {
Set-WMIInstance `
-class WEKF_Scancode `
-argument @{Modifiers="$Modifiers"; Scancode=$Code} `
@CommonParams | Out-Null
"Added Custom Scancode {0}+{1:X4}" -f $Modifiers, $Code
}
}
# Some example uses of the functions defined above.
Enable-Predefined-Key "Ctrl+Alt+Del"
Enable-Predefined-Key "Ctrl+Esc"
Enable-Custom-Key "Ctrl+V"
Enable-Custom-Key "Numpad0"
Enable-Custom-Key "Shift+Numpad1"
Enable-Custom-Key "%"
Enable-Scancode "Ctrl" 37
```
## Related topics
[Windows PowerShell script samples for keyboard filter](keyboardfilter-powershell-script-samples.md)
[Keyboard filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
[Keyboard filter](index.md)

View File

@ -0,0 +1,181 @@
---
title: Keyboard Filter key names
description: Keyboard Filter key names
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# Keyboard Filter key names
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
You can configure Keyboard Filter to block keys or key combinations. A key combination consists of one or more modifier keys, separated by a plus sign (+), and either a key name or a key scan code. In addition to the keys listed in the following tables, you can use the predefined key combinations names as custom key combinations. However, we recommend using the predefined key settings when enabling or disabling predefined key combinations.
The key names are grouped as follows:
- [Modifier keys](#modifier-keys)
- [System keys](#system-keys)
- [Cursor and edit keys](#cursor-and-edit-keys)
- [State keys](#state-keys)
- [OEM keys](#oem-keys)
- [Function keys](#function-keys)
- [Numeric keypad keys](#numeric-keypad-keys)
## Modifier keys
You can use the modifier keys listed in the following table when you configure keyboard filter. Multiple modifiers are separated by a plus sign (+). You can also configure Keyboard Filter to block any modifier key even if it's not part of a key combination.
| Modifier key name | Virtual key | Description |
| ----------------- | ----------- | ----------- |
| `Ctrl` | VK_CONTROL | The <kbd>Ctrl</kbd> key |
| `LCtrl` | VK_LCONTROL | The left <kbd>Ctrl</kbd> key |
| `RCtrl` | VK_RCONTROL | The right <kbd>Ctrl</kbd> key |
| `Control` | VK_CONTROL | The <kbd>Ctrl</kbd> key |
| `LControl` | VK_LCONTROL | The left <kbd>Ctrl</kbd> key |
| `RControl` | VK_RCONTROL | The right <kbd>Ctrl</kbd> key |
| `Alt` | VK_MENU | The <kbd>Alt</kbd> key |
| `LAlt` | VK_LMENU | The left <kbd>Alt</kbd> key |
| `RAlt` | VK_RMENU | The right <kbd>Alt</kbd> key |
| `Shift` | VK_SHIFT | The <kbd>Shift</kbd> key |
| `LShift` | VK_LSHIFT | The left <kbd>Shift</kbd> key |
| `RShift` | VK_RSHIFT | The right <kbd>Shift</kbd> key |
| `Win` | VK_WIN | The <kbd>Windows</kbd> logo key |
| `LWin` | VK_LWIN | The left <kbd>Windows</kbd> logo key |
| `RWin` | VK_RWIN | The right <kbd>Windows</kbd> logo key |
| `Windows` | VK_WIN | The <kbd>Windows</kbd> logo key |
| `LWindows` | VK_LWIN | The left <kbd>Windows</kbd> logo key |
| `RWindows` | VK_RWIN | The right <kbd>Windows</kbd> key |
## System keys
| Modifier key name | Virtual key | Description |
| ----------------- | ----------- | ----------- |
| `Ctrl` | VK_CONTROL | The <kbd>Ctrl</kbd> key |
| `LCtrl` | VK_LCONTROL | The left <kbd>Ctrl</kbd> key |
| `RCtrl` | VK_RCONTROL | The right <kbd>Ctrl</kbd> key |
| `Control` | VK_CONTROL | The <kbd>Ctrl</kbd> key |
| `LControl` | VK_LCONTROL | The left <kbd>Ctrl</kbd> key |
| `RControl` | VK_RCONTROL | The right <kbd>Ctrl</kbd> key |
| `Alt` | VK_MENU | The <kbd>Alt</kbd> key |
| `LAlt` | VK_LMENU | The left <kbd>Alt</kbd> key |
| `RAlt` | VK_RMENU | The right <kbd>Alt</kbd> key |
| `Shift` | VK_SHIFT | The <kbd>Shift</kbd> key |
| `LShift` | VK_LSHIFT | The left <kbd>Shift</kbd> key |
| `RShift` | VK_RSHIFT | The right <kbd>Shift</kbd> key |
| `Win` | VK_WIN | The <kbd>Windows</kbd> logo key |
| `LWin` | VK_LWIN | The left <kbd>Windows</kbd> logo key |
| `RWin` | VK_RWIN | The right <kbd>Windows</kbd> logo key |
| `Windows` | VK_WIN | The <kbd>Windows</kbd> logo key |
| `LWindows` | VK_LWIN | The left <kbd>Windows</kbd> logo key |
| `RWindows` | VK_RWIN | The right <kbd>Windows</kbd> logo key |
## Cursor and edit keys
| Key name | Virtual key | Description |
| ----------------- | ----------- | ----------- |
| `PageUp` | VK_PRIOR | The <kbd>Page Up</kbd> key |
| `Prior` | VK_PRIOR | The <kbd>Page Up</kbd> key |
| `PgUp` | VK_PRIOR | The <kbd>Page Up</kbd> key |
| `PageDown` | VK_NEXT | The <kbd>Page Down</kbd> key |
| `PgDown` | VK_NEXT | The <kbd>Page Down</kbd> key |
| `Next` | VK_NEXT | The <kbd>Page Down</kbd> key |
| `End` | VK_END | The <kbd>End</kbd> key |
| `Home` | VK_HOME | The <kbd>Home</kbd> key |
| `Left` | VK_LEFT | The <kbd>Left Arrow</kbd> key |
| `Up` | VK_UP | The <kbd>Up Arrow</kbd> key |
| `Right` | VK_RIGHT | The <kbd>Right Arrow</kbd> key |
| `Down` | VK_DOWN | The <kbd>Down Arrow</kbd> key |
| `Insert` | VK_INSERT | The <kbd>Insert</kbd> key |
| `Delete` | VK_DELETE | The <kbd>Delete</kbd> key |
| `Del` | VK_DELETE | The <kbd>Delete</kbd> key |
| `Separator` | VK_SEPARATOR | The <kbd>Separator</kbd> key |
## State keys
| Key name | Virtual key | Description |
| ----------------- | ----------- | ----------- |
| `NumLock` | VK_NUMLOCK | The <kbd>Num Lock</kbd> key |
| `ScrollLock` | VK_SCROLL | The <kbd>Scroll Lock</kbd> key |
| `Scroll` | VK_SCROLL | The <kbd>Scroll Lock</kbd> key |
| `CapsLock` | VK_CAPITAL | The <kbd>Caps Lock</kbd> key |
| `Capital` | VK_CAPITAL | The <kbd>Caps Lock</kbd> key |
## OEM keys
| Key name | Virtual key | Description |
| ----------------- | ----------- | ----------- |
| `KeypadEqual` | VK_OEM_NEC_EQUAL | The <kbd>Equals (=)</kbd> key on the numeric keypad (OEM-specific) |
| `Dictionary` | VK_OEM_FJ_JISHO | The Dictionary key (OEM-specific) |
| `Unregister` | VK_OEM_FJ_MASSHOU | The Unregister Word key (OEM-specific) |
| `Register` | VK_OEM_FJ_TOUROKU | The Register Word key (OEM-specific) |
| `LeftOyayubi` | VK_OEM_FJ_LOYA | The Left OYAYUBI key (OEM-specific) |
| `RightOyayubi` | VK_OEM_FJ_ROYA | The Right OYAYUBI key (OEM-specific) |
| `OemPlus` | VK_OEM_PLUS | For any country/region, the <kbd>Plus Sign (+)</kbd> key |
| `OemComma` | VK_OEM_COMMA | For any country/region, the <kbd>Comma (,)</kbd> key |
| `OemMinus` | VK_OEM_MINUS | For any country/region, the <kbd>Minus Sign (-)</kbd> key |
| `OemPeriod` | VK_OEM_PERIOD | For any country/region, the <kbd>Period (.)</kbd> key |
| `Oem1` | VK_OEM_1 | Varies by keyboard |
| `Oem2` | VK_OEM_2 | Varies by keyboard |
| `Oem3` | VK_OEM_3 | Varies by keyboard |
| `Oem4` | VK_OEM_4 | Varies by keyboard |
| `Oem5` | VK_OEM_5 | Varies by keyboard |
| `Oem6` | VK_OEM_6 | Varies by keyboard |
| `Oem7` | VK_OEM_7 | Varies by keyboard |
| `Oem8` | VK_OEM_8 | Varies by keyboard |
| `OemAX` | VK_OEM_AX | The <kbd>AX</kbd> key on a Japanese AX keyboard |
| `Oem102` | VK_OEM_102 | Either the angle bracket key or the backslash key on the RT 102-key keyboard |
## Function keys
| Key name | Virtual key | Description |
| ----------------- | ----------- | ----------- |
| `F1` | VK_F1 | The <kbd>F1</kbd> key |
| `F2` | VK_F2 | The <kbd>F2</kbd> key |
| `F3` | VK_F3 | The <kbd>F3</kbd> key |
| `F4` | VK_F4 | The <kbd>F4</kbd> key |
| `F5` | VK_F5 | The <kbd>F5</kbd> key |
| `F6` | VK_F6 | The <kbd>F6</kbd> key |
| `F7` | VK_F7 | The <kbd>F7</kbd> key |
| `F8` | VK_F8 | The <kbd>F8</kbd> key |
| `F9` | VK_F9 | The <kbd>F9</kbd> key |
| `F10` | VK_F10 | The <kbd>F10</kbd> key |
| `F11` | VK_F11 | The <kbd>F11</kbd> key |
| `F12` | VK_F12 | The <kbd>F12</kbd> key |
| `F13` | VK_F13 | The <kbd>F13</kbd> key |
| `F14` | VK_F14 | The <kbd>F14</kbd> key |
| `F15` | VK_F15 | The <kbd>F15</kbd> key |
| `F16` | VK_F16 | The <kbd>F16</kbd> key |
| `F17` | VK_F17 | The <kbd>F17</kbd> key |
| `F18` | VK_F18 | The <kbd>F18</kbd> key |
| `F19` | VK_F19 | The <kbd>F19</kbd> key |
| `F20` | VK_F20 | The <kbd>F20</kbd> key |
| `F21` | VK_F21 | The <kbd>F21</kbd> key |
| `F22` | VK_F22 | The <kbd>F22</kbd> key |
| `F23` | VK_F23 | The <kbd>F23</kbd> key |
| `F24` | VK_F24 | The <kbd>F24</kbd> key |
## Numeric keypad keys
| Key name | Virtual key | Description |
| ----------------- | ----------- | ----------- |
| `Numpad0` | VK_NUMPAD0 | The <kbd>0</kbd> key on the numeric keypad |
| `Numpad1` | VK_NUMPAD1 | The <kbd>1</kbd> key on the numeric keypad |
| `Numpad2` | VK_NUMPAD2 | The <kbd>2</kbd> key on the numeric keypad |
| `Numpad3` | VK_NUMPAD3 | The <kbd>3</kbd> key on the numeric keypad |
| `Numpad4` | VK_NUMPAD4 | The <kbd>4</kbd> key on the numeric keypad |
| `Numpad5` | VK_NUMPAD5 | The <kbd>5</kbd> key on the numeric keypad |
| `Numpad6` | VK_NUMPAD6 | The <kbd>6</kbd> key on the numeric keypad |
| `Numpad7` | VK_NUMPAD7 | The <kbd>7</kbd> key on the numeric keypad |
| `Numpad8` | VK_NUMPAD8 | The <kbd>8</kbd> key on the numeric keypad |
| `Numpad9` | VK_NUMPAD9 | The <kbd>9</kbd> key on the numeric keypad |
| `Multiply` | VK_MULTIPLY | The <kbd>Multiply (*)</kbd> key on the numeric keypad |
| `Add` | VK_ADD | The <kbd>Add (+)</kbd> key on the numeric keypad |
| `Subtract` | VK_SUBTRACT | The <kbd>Subtract (-)</kbd> key on the numeric keypad |
| `Decimal` | VK_DECIMAL | The <kbd>Decimal (.)</kbd> key on the numeric keypad |
| `Divide` | VK_DIVIDE | The <kbd>Divide (/)</kbd> key on the numeric keypad |
## Related articles
- [Keyboard filter](index.md)

View File

@ -0,0 +1,73 @@
---
title: List all configured key combinations
description: List all configured key combinations
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# List all configured key combinations
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
The following sample Windows PowerShell script uses the Windows Management Instrumentation (WMI) providers for Keyboard Filter to displays all key combination configurations for Keyboard Filter.
## List-rules.ps1
```powershell
#
# Copyright (C) Microsoft. All rights reserved.
#
<#
.Synopsis
Enumerate all active keyboard filter rules on the system.
.Description
For each instance of WEKF_PredefinedKey, WEKF_CustomKey, and WEKF_Scancode,
get the Enabled property. If Enabled, then output a short description
of the rule.
.Parameter ComputerName
Optional parameter to specify the remote machine that this script should
manage. If not specified, the script will execute all WMI operations
locally.
#>
param (
[String] $ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"}
$CommonParams += $PSBoundParameters
write-host Enabled Predefined Keys -foregroundcolor cyan
Get-WMIObject -class WEKF_PredefinedKey @CommonParams |
foreach {
if ($_.Enabled) {
write-host $_.Id
}
}
write-host Enabled Custom Keys -foregroundcolor cyan
Get-WMIObject -class WEKF_CustomKey @CommonParams |
foreach {
if ($_.Enabled) {
write-host $_.Id
}
}
write-host Enabled Scancodes -foregroundcolor cyan
Get-WMIObject -class WEKF_Scancode @CommonParams |
foreach {
if ($_.Enabled) {
"{0}+{1:X4}" -f $_.Modifiers, $_.Scancode
}
}
```
## Related articles
[Windows PowerShell script samples for keyboard filter](keyboardfilter-powershell-script-samples.md)
[Keyboard filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
[Keyboard filter](index.md)

View File

@ -0,0 +1,28 @@
---
title: Windows PowerShell script samples for Keyboard Filter
description: Windows PowerShell script samples for Keyboard Filter
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# Windows PowerShell script samples for Keyboard Filter
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
The list below describes sample Windows PowerShell scripts that demonstrate how to use the Windows Management Instrumentation (WMI) providers for Keyboard Filter.
| Script | Description |
| ------ | ----------- |
| [Add blocked key combinations](keyboardfilter-add-blocked-key-combinations.md) | Demonstrates how to block key combinations for Keyboard Filter.|
| [Disable all blocked key combinations](disable-all-blocked-key-combinations.md) | Demonstrates how to disable all blocked key combinations for Keyboard Filter. |
| [List all configured key combinations](keyboardfilter-list-all-configured-key-combinations.md) | Demonstrates how to list all defined key combination configurations for Keyboard Filter. |
| [Modify global settings](modify-global-settings.md) | Demonstrates how to modify global settings for Keyboard Filter. |
| [Remove key combination configurations](remove-key-combination-configurations.md) | Demonstrates how to remove a custom defined key combination configuration for Keyboard Filter. |
## Related articles
[Keyboard Filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
[Keyboard Filter](index.md)

View File

@ -0,0 +1,25 @@
---
title: Keyboard Filter WMI provider reference
description: Keyboard Filter WMI provider reference
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# Keyboard Filter WMI provider reference
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
Describes the Windows Management Instrumentation (WMI) provider classes that you use to configure Keyboard Filter during run time.
| WMI Provider Class | Description |
| ------------------ | ----------- |
| [WEKF_CustomKey](wekf-customkey.md) | Blocks or unblocks custom defined key combinations. |
| [WEKF_PredefinedKey](wekf-predefinedkey.md) | Blocks or unblocks predefined key combinations. |
| [WEKF_Scancode](wekf-scancode.md) | Blocks or unblocks key combinations by using keyboard scan codes. |
| [WEKF_Settings](wekf-settings.md) | Enables or disables settings for Keyboard Filter. |
## Related topics
[Keyboard filter](index.md)

View File

@ -0,0 +1,174 @@
---
title: Modify global settings
description: Modify global settings
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: how-to
---
# Modify global settings
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
The following sample Windows PowerShell scripts use the Windows Management Instrumentation (WMI) providers to modify global settings for Keyboard Filter.
The function **Get-Setting** retrieves the value of a global setting for Keyboard Filter.
In the first script, the function **Set-DisableKeyboardFilterForAdministrators** modifies the value of the **DisableKeyboardFilterForAdministrators** setting.
In the second script, the function **Set-ForceOffAccessibility** modifies the value of the **ForceOffAccessibility** setting.
## Set-DisableKeyboardFilterForAdministrators.ps1
```powershell
#
# Copyright (C) Microsoft. All rights reserved.
#
<#
.Synopsis
This script shows how to enumerate WEKF_Settings to find global settings
that can be set on the keyboard filter. In this specific script, the
global setting to be set is "DisableKeyboardFilterForAdministrators".
.Parameter ComputerName
Optional parameter to specify a remote computer that this script should
manage. If not specified, the script will execute all WMI operations
locally.
.Parameter On
Switch if present that sets "DisableKeyboardFilterForAdministrators" to
true. If not present, sets the setting to false.
#>
param (
[Switch] $On = $False,
[String] $ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"};
if ($PSBoundParameters.ContainsKey("ComputerName")) {
$CommonParams += @{"ComputerName" = $ComputerName};
}
function Get-Setting([String] $Name) {
<#
.Synopsis
Get a WMIObject by name from WEKF_Settings
.Parameter Name
The name of the setting, which is the key for the WEKF_Settings class.
#>
$Entry = Get-WMIObject -class WEKF_Settings @CommonParams |
where {
$_.Name -eq $Name
}
return $Entry
}
function Set-DisableKeyboardFilterForAdministrators([Bool] $Value) {
<#
.Synopsis
Set the DisableKeyboardFilterForAdministrators setting to true or
false.
.Description
Set DisableKeyboardFilterForAdministrators to true or false based
on $Value
.Parameter Value
A Boolean value
#>
$Setting = Get-Setting("DisableKeyboardFilterForAdministrators")
if ($Setting) {
if ($Value) {
$Setting.Value = "true"
} else {
$Setting.Value = "false"
}
$Setting.Put() | Out-Null;
} else {
Write-Error "Unable to find DisableKeyboardFilterForAdministrators setting";
}
}
Set-DisableKeyboardFilterForAdministrators $On
```
## Set-ForceOffAccessibility.ps1
```powershell
#
# Copyright (C) Microsoft. All rights reserved.
#
<#
.Synopsis
This script shows how to enumerate WEKF_Settings to find global settings
that can be set on the keyboard filter. In this specific script, the
global setting to be set is "ForceOffAccessibility".
.Parameter ComputerName
Optional parameter to specify a remote computer that this script should
manage. If not specified, the script will execute all WMI operations
locally.
.Parameter Enabled
Switch if present that sets "ForceOffAccessibility" to true. If not
present, sets the setting to false.
#>
param (
[Switch] $Enabled = $False,
[String] $ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"};
if ($PSBoundParameters.ContainsKey("ComputerName")) {
$CommonParams += @{"ComputerName" = $ComputerName};
}
function Get-Setting([String] $Name) {
<#
.Synopsis
Get a WMIObject by name from WEKF_Settings
.Parameter Name
The name of the setting, which is the key for the WEKF_Settings class.
#>
$Entry = Get-WMIObject -class WEKF_Settings @CommonParams |
where {
$_.Name -eq $Name
}
return $Entry
}
function Set-ForceOffAccessibility([Bool] $Value) {
<#
.Synopsis
Set the ForceOffAccessibility setting to true or false.
.Description
Set ForceOffAccessibility to true or false based on $Value
.Parameter Value
A Boolean value
#>
$Setting = Get-Setting("ForceOffAccessibility")
if ($Setting) {
if ($Value) {
$Setting.Value = "true"
} else {
$Setting.Value = "false"
}
$Setting.Put() | Out-Null;
} else {
Write-Error "Unable to find ForceOffAccessibility setting";
}
}
Set-ForceOffAccessibility $Enabled
```
## Related topics
[Windows PowerShell script samples for keyboard filter](keyboardfilter-powershell-script-samples.md)
[WEKF_Settings](wekf-settings.md)
[Keyboard filter](index.md)

View File

@ -0,0 +1,162 @@
---
title: Predefined key combinations
description: Predefined key combinations
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# Predefined key combinations
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
This topic lists a set of key combinations that are predefined by a keyboard filter. You can list the value of the WEKF_PredefinedKey.Id to get a complete list of key combinations defined by a keyboard filter.
You can use the values in the WEKF_PredefinedKey.Id column to configure the Windows Management Instrumentation (WMI) class [WEKF_PredefinedKey](wekf-predefinedkey.md).
## Accessibility keys
The following table contains predefined key combinations for accessibility:
| Key combination | WEKF_PredefinedKey.Id | Blocked behavior |
|:-------------------------------------|:--------------------------|:----------------------------|
| Left Alt + Left Shift + Print Screen | **LShift+LAlt+PrintScrn** | Open High Contrast. |
| Left Alt + Left Shift + Num Lock | **LShift+LAlt+NumLock** | Open Mouse Keys. |
| Windows logo key + U | **Win+U** | Open Ease of Access Center. |
## Application keys
The following table contains predefined key combinations for controlling application state:
| Key combination | WEKF_PredefinedKey.Id | Blocked behavior |
|:----------------------|:----------------------|:-------------------|
| Alt + F4 | **Alt+F4** | Close application. |
| Ctrl + F4 | **Ctrl+F4** | Close window. |
| Windows logo key + F1 | **Win+F1** | Open Windows Help. |
## Shell keys
The following table contains predefined key combinations for general UI control:
| Key combination | WEKF_PredefinedKey.Id | Blocked behavior |
|:---------------------------------------|:----------------------|:-------------------------------------------------------------------------------------------------------------------------------------|
| Alt + Spacebar | **Alt+Space** | Open shortcut menu for the active window. |
| Ctrl + Esc | **Ctrl+Esc** | Open the Start screen. |
| Ctrl + Windows logo key + F | **Ctrl+Win+F** | Open Find Computers. |
| Windows logo key + Break | **Win+Break** | Open System dialog box. |
| Windows logo key + E | **Win+E** | Open Windows Explorer. |
| Windows + F | **Win+F** | Open Search. |
| Windows logo key + P | **Win+P** | Cycle through Presentation Mode. Also blocks the Windows logo key + Shift + P and the Windows logo key + Ctrl + P key combinations. |
| Windows logo key + R | **Win+R** | Open Run dialog box. |
| Alt + Tab | **Alt+Tab** | Switch task. Also blocks the Alt + Shift + Tab key combination. |
| Ctrl + Tab | **Ctrl+Tab** | Switch window. |
| Windows logo key + Tab | **Win+Tab** | Cycle through Microsoft Store apps. Also blocks the Windows logo key + Ctrl + Tab and Windows logo key + Shift + Tab key combinations. |
| Windows logo key + D | **Win+D** | Show desktop. |
| Windows logo key + M | **Win+M** | Minimize all windows. |
| Windows logo key + Home | **Win+Home** | Minimize or restore all inactive windows. |
| Windows logo key + T | **Win+T** | Set focus on taskbar and cycle through programs. |
| Windows logo key + B | **Win+B** | Set focus in the notification area. |
| Windows logo key + Minus Sign | **Win+-** | Zoom out. |
| Windows logo key + Plus Sign | **Win++** | Zoom in. |
| Windows logo key + Esc | **Win+Esc** | Close Magnifier application. |
| Windows logo key + Up Arrow | **Win+Up** | Maximize the active window. |
| Windows logo key + Down Arrow | **Win+Down** | Minimize the active window. |
| Windows logo key + Left Arrow | **Win+Left** | Snap the active window to the left half of screen. |
| Windows logo key + Right Arrow | **Win+Right** | Snap the active window to the right half of screen. |
| Windows logo key + Shift + Up Arrow | **Win+Shift+Up** | Maximize the active window vertically. |
| Windows logo key + Shift + Down Arrow | **Win+Shift+Down** | Minimize the active window. |
| Windows logo key + Shift + Left Arrow | **Win+Shift+Left** | Move the active window to left monitor. |
| Windows logo key + Shift + Right Arrow | **Win+Shift+Right** | Move the active window to right monitor. |
| Windows logo key + Spacebar | **Win+Space** | Switch layout. |
| Windows logo key + O | **Win+O** | Lock device orientation. |
| Windows logo key + Page Up | **Win+PageUp** | Move a Microsoft Store app to the left monitor. |
| Windows logo key + Page Down | **Win+PageDown** | Move a Microsoft Store app to right monitor. |
| Windows logo key + Period | **Win+.** | Snap the current screen to the left or right gutter. Also blocks the Windows logo key + Shift + Period key combination. |
| Windows logo key + C | **Win+C** | Activate Cortana in listening mode (after user has enabled the shortcut through the UI). |
| Windows logo key + I | **Win+I** | Open Settings charm. |
| Windows logo key + K | **Win+K** | Open Connect charm. |
| Windows logo key + H | **Win+H** | Start dictation. |
| Windows logo key + Q | **Win+Q** | Open Search charm. |
| Windows logo key + W | **Win+W** | Open Windows Ink workspace. |
| Windows logo key + Z | **Win+Z** | Open app bar. |
| Windows logo key + / | **Win+/** | Open input method editor (IME). |
| Windows logo key + J | **Win+J** | Swap between snapped and filled applications. |
| Windows logo key + Comma | **Win+,** | Peek at the desktop. |
| Windows logo key + V | **Win+V** | Cycle through toasts in reverse order. |
## Modifier keys
The following table contains predefined key combinations for modifier keys (such as Shift and Ctrl):
| Key combination | WEKF_PredefinedKey.Id | Blocked key |
|:-----------------|:----------------------|:-----------------------|
| Alt | **Alt** | Both Alt keys |
| Application | **Application** | Application key |
| Ctrl | **Ctrl** | Both Ctrl keys |
| Shift | **Shift** | Both Shift keys |
| Windows logo key | **Windows** | Both Windows logo keys |
## Security keys
The following table contains predefined key combinations for OS security:
| Key combination | WEKF_PredefinedKey.Id | Blocked behavior |
|:-----------------------|:----------------------|:----------------------------------|
| Ctrl + Alt + Delete | **Ctrl+Alt+Del** | Open the Windows Security screen. |
| Ctrl + Shift + Esc | **Shift+Ctrl+Esc** | Open Task Manager. |
| Windows logo key + L | **Win+L** | Lock the device. |
## Extended shell keys
The following table contains predefined key combinations for extended shell functions (such as automatically opening certain apps):
| Key combination | WEKF_PredefinedKey.Id | Blocked key |
|:--------------------|:----------------------|:------------------------|
| LaunchMail | **LaunchMail** | Start Mail key |
| LaunchMediaSelect | **LaunchMediaSelect** | Select Media key |
| LaunchApp1 | **LaunchApp1** | Start Application 1 key |
| LaunchApp2 | **LaunchApp2** | Start Application 2 key |
## Browser keys
The following table contains predefined key combinations for controlling the browser:
| Key combination | WEKF_PredefinedKey.Id | Blocked key |
|:-----------------|:----------------------|:---------------------------|
| BrowserBack | **BrowserBack** | Browser Back key |
| BrowserForward | **BrowserForward** | Browser Forward key |
| BrowserRefresh | **BrowserRefresh** | Browser Refresh key |
| BrowserStop | **BrowserStop** | Browser Stop key |
| BrowserSearch | **BrowserSearch** | Browser Search key |
| BrowserFavorites | **BrowserFavorites** | Browser Favorites key |
| BrowserHome | **BrowserHome** | Browser Start and Home key |
## Media keys
The following table contains predefined key combinations for controlling media playback:
| Key combination | WEKF_PredefinedKey.Id | Blocked key |
|:----------------|:----------------------|:---------------------|
| VolumeMute | **VolumeMute** | Volume Mute key |
| VolumeDown | **VolumeDown** | Volume Down key |
| VolumeUp | **VolumeUp** | Volume Up key |
| MediaNext | **MediaNext** | Next Track key |
| MediaPrev | **MediaPrev** | Previous Track key |
| MediaStop | **MediaStop** | Stop Media key |
| MediaPlayPause | **MediaPlayPause** | Play/Pause Media key |
## Microsoft Surface keyboard keys
The following table contains predefined key combinations for Microsoft Surface devices:
| Key combination | WEKF_PredefinedKey.Id | Blocked key |
|:------------------------------|:----------------------|:-------------|
| Left Alt + Windows logo key | **AltWin** | Share key |
| Left Ctrl + Windows logo key | **CtrlWin** | Devices key |
| Left Shift + Windows logo key | **ShiftWin** | Search key |
| F21 | **F21** | Settings key |
## Related topics
[Keyboard filter](index.md)

View File

@ -0,0 +1,108 @@
---
title: Remove key combination configurations
description: Remove key combination configurations
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# Remove key combination configurations
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
The following sample Windows PowerShell script uses the Windows Management Instrumentation (WMI) providers for Keyboard Filter to create two functions to remove custom-defined key combination configurations from Keyboard Filter. It demonstrates several ways to use each function.
The first function, **Remove-Custom-Key**, removes custom key combination configurations.
The second function, **Remove-Scancode**, removes custom scan code configurations.
You can't remove the predefined key combination configurations for Keyboard Filter, but you can disable them.
## Remove-rules.ps1
```powershell
#
# Copyright (C) Microsoft. All rights reserved.
#
<#
.Synopsis
This script shows how to use the build in WMI providers to remove keyboard filter rules. Rules of type WEKF_PredefinedKey cannot be removed.
.Parameter ComputerName
Optional parameter to specify the remote computer that this script should
manage. If not specified, the script will execute all WMI operations
locally.
#>
param(
[string] $ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"}
$CommonParams += $PSBoundParameters
function Remove-Custom-Key($Id) {
<#
.Synopsis
Remove an instance of WEKF_CustomKey
.Description
Enumerate all instances of WEKF_CustomKey. When an instance has an
Id that matches $Id, delete it.
.Example
Remove-Custom-Key "Ctrl+V"
This removes the instance of WEKF_CustomKey with a key Id of "Ctrl+V"
#>
$customInstance = Get-WMIObject -class WEKF_CustomKey @CommonParams |
where {$_.Id -eq $Id}
if ($customInstance) {
$customInstance.Delete();
"Removed Custom Filter $Id.";
} else {
"Custom Filter $Id does not exist.";
}
}
function Remove-Scancode($Modifiers, [int]$Code) {
<#
.Synopsis
Remove and instance of WEKF_Scancode
.Description
Enumerate all instances of WEKF_Scancode. When an instance has a
matching modifiers and code, delete it.
.Example
Remove-Scancode "Ctrl" 37
This removes the instance of WEKF_Scancode with Modifiers="Ctrl" and
Scancode=37.
#>
$scancodeInstance = Get-WMIObject -class WEKF_Scancode @CommonParams |
where {($_.Modifiers -eq $Modifiers) -and ($_.Scancode -eq $Code)}
if ($scancodeInstance) {
$scancodeInstance.Delete();
"Removed Scancode $Modifiers+$Code.";
} else {
"Scancode $Modifiers+$Code does not exist.";
}
}
# Some example uses of the functions defined above.
Remove-Custom-Key "Ctrl+V"
Remove-Custom-Key "Numpad0"
Remove-Custom-Key "Shift+Numpad1"
Remove-Custom-Key "%"
Remove-Scancode "Ctrl" 37
```
## Related articles
[Windows PowerShell script samples for keyboard filter](keyboardfilter-powershell-script-samples.md)
[Keyboard filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
[Keyboard filter](index.md)

View File

@ -0,0 +1,53 @@
items:
- name: Keyboard Filter
items:
- name: About keyboard filter
href: index.md
- name: Key Names
href: keyboardfilter-key-names.md
- name: Predefined Key Combinations
href: keyboardfilter-list-all-configured-key-combinations.md
- name: WMI Provider Reference
items:
- name: Overview
href: keyboardfilter-wmi-provider-reference.md
- name: Class WEKF_CustomKey
items:
- name: Overview
href: wekf-customkey.md
- name: Add
href: wekf-customkeyadd.md
- name: Remove
href: wekf-customkeyremove.md
- name: Class WEKF_PredefinedKey
items:
- name: Overview
href: wekf-predefinedkey.md
- name: Disable
href: wekf-predefinedkeydisable.md
- name: Enable
href: wekf-predefinedkeyenable.md
- name: Class WEKF_Scancode
items:
- name: Overview
href: wekf-scancode.md
- name: Add
href: wekf-scancodeadd.md
- name: Remove
href: wekf-scancoderemove.md
- name: Class WEKF-Settings
href: wekf-settings.md
- name: PowerShell script samples
items:
- name: Overview
href: keyboardfilter-powershell-script-samples.md
- name: Add blocked key Combinations
href: keyboardfilter-add-blocked-key-combinations.md
- name: Disable all blocked key Combinations
href: disable-all-blocked-key-combinations.md
- name: List all configured key combinations
href: keyboardfilter-list-all-configured-key-combinations.md
- name: Modify global settings
href: modify-global-settings.md
- name: Remove key combination configurations
href: remove-key-combination-configurations.md

View File

@ -0,0 +1,130 @@
---
title: WEKF_CustomKey
description: WEKF_CustomKey
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_CustomKey
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
Adds or removes custom-defined key combinations.
## Syntax
```powershell
class WEKF_CustomKey {
[Static] uint32 Add(
[In] string CustomKey
);
[Static] uint32 Remove(
[In] string CustomKey
);
[Key] string Id;
[Read, Write] boolean Enabled;
};
```
## Members
The following tables list any methods and properties that belong to this class.
### Methods
| Methods | Description |
|---------|-------------|
| [WEKF_CustomKey.Add](wekf-customkeyadd.md) | Creates a new custom key combination and enables Keyboard Filter to block the new key combination. |
| [WEKF_CustomKey.Remove](wekf-customkeyremove.md) | Removes the specified custom key combination. Keyboard Filter stops blocking the key combination that was removed. |
### Properties
| Property | Data&nbsp;type | Qualifiers | Description |
|----------|----------------|------------|--------------|
| **Id** | string | [key] | The name of the custom key combination. |
| **Enabled** | Boolean | [read, write] | Indicates if the key is blocked or unblocked. This property can be one of the following values </br>- **true** Indicates that the key is blocked.</br>- **false** Indicates that the key isn't blocked. |
### Remarks
You can specify key combinations by including the modifier keys in the name. The most common modifier names are <kbd>>Ctrl</kbd>, <kbd>>Shift</kbd>, <kbd>>Alt</kbd>, and <kbd>>Win</kbd>. You can't block a combination of non-modifier keys. For example, you can block a key combination of <kbd>>Ctrl</kbd>+<kbd>>Shift</kbd>+<kbd>>F</kbd>, but you can't block a key combination of <kbd>>A</kbd>+<kbd>>D</kbd>.
When you block a <kbd>>Shift</kbd>-modified key, you must enter the key as <kbd>>Shift</kbd> + the unmodified key. For example, to block the <kbd>>%</kbd> key on an English keyboard layout, you must specify the key as <kbd>>Shift</kbd>+<kbd>>5</kbd>. Attempting to block <kbd>>%</kbd>, results in Keyboard Filter blocking <kbd>>5</kbd> instead.
When you specify the key combination to block, you must use the English names for the keys. For a list of the key names you can specify, see Keyboard Filter key names.
## Example
The following code demonstrates how to add or enable a custom key combination that Keyboard Filter will block by using the Windows Management Instrumentation (WMI) providers for Keyboard Filter. This example modifies the properties directly and doesn't call any of the methods defined in **WEKF_CustomKey**.
```powershell
<#
.Synopsis
This script shows how to use the WMI provider to enable and add
Keyboard Filter rules through Windows PowerShell on the local computer.
.Parameter ComputerName
Optional parameter to specify a remote machine that this script should
manage. If not specified, the script will execute all WMI operations
locally.
#>
param (
[String] $ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"}
$CommonParams += $PSBoundParameters
function Enable-Custom-Key($Id) {
<#
.Synopsis
Toggle on a Custom Key Keyboard Filter Rule
.Description
Use Get-WMIObject to enumerate all WEKF_CustomKey instances,
filter against key value "Id", and set that instance's "Enabled"
property to 1/true.
In the case that the Custom instance does not exist, add a new
instance of WEKF_CustomKey using Set-WMIInstance.
.Example
Enable-Custom-Key "Ctrl+V"
Enable filtering of the Ctrl + V sequence.
#>
$custom = Get-WMIObject -class WEKF_CustomKey @CommonParams |
where {
$_.Id -eq "$Id"
};
if ($custom) {
# Rule exists. Just enable it.
$custom.Enabled = 1;
$custom.Put() | Out-Null;
"Enabled Custom Filter $Id.";
} else {
Set-WMIInstance `
-class WEKF_CustomKey `
-argument @{Id="$Id"} `
@CommonParams | Out-Null
"Added Custom Filter $Id.";
}
}
# Some example uses of the function defined above.
Enable-Custom-Key "Ctrl+V"
Enable-Custom-Key "Numpad0"
Enable-Custom-Key "Shift+Numpad1"
```
## Related articles
[Keyboard Filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
[Keyboard Filter key names](keyboardfilter-key-names.md)

View File

@ -0,0 +1,96 @@
---
title: WEKF_CustomKey.Add
description: WEKF_CustomKey.Add
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_CustomKey.Add
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
Creates a new custom key combination and enables Keyboard Filter to block the new key combination.
## Syntax
```powershell
[Static] uint32 Add(
[In] string CustomKey
);
```
## Parameters
**CustomKey**</br>\[in\] The custom key combination to add. For a list of valid key names, see [Keyboard Filter key names](keyboardfilter-key-names.md).
## Return Value
Returns an HRESULT value that indicates a [WMI Non-Error Constant](/windows/win32/wmisdk/wmi-non-error-constants) or a [WMI Error Constant](/windows/win32/wmisdk/wmi-error-constants).
## Remarks
**WEKF_CustomKey.Add** creates a new **WEKF_CustomKey** object and sets the **Enabled** property of the new object to **true**, and the **Id** property to *CustomKey*.
If a **WEKF_CustomKey** object already exists with the **Id** property equal to *CustomKey*, then **WEKF_CustomKey.Add** returns an error code and doesn't create a new object or modify any properties of the existing object. If the existing **WEKF_CustomKey** object has the **Enabled** property set to **false**, Keyboard Filter does not block the custom key combination.
## Example
The following code demonstrates how to add or enable a custom key that Keyboard Filter will block by using the Windows Management Instrumentation (WMI) providers for Keyboard Filter.
```powershell
$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"
# Create a handle to the class instance so we can call the static methods
$classCustomKey = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WEKF_CustomKey"
# Create a function to add or enable a key combination for Keyboard Filter to block
function Enable-Custom-Key($KeyId) {
# Check to see if the custom key object already exists
$objCustomKey = Get-WMIObject -namespace $NAMESPACE -class WEKF_CustomKey |
where {$_.Id -eq "$KeyId"};
if ($objCustomKey) {
# The custom key already exists, so just enable it
$objCustomKey.Enabled = 1;
$objCustomKey.Put() | Out-Null;
"Enabled ${KeyId}.";
} else {
# Create a new custom key object by calling the static Add method
$retval = $classCustomKey.Add($KeyId);
# Check the return value to verify that the Add is successful
if ($retval.ReturnValue -eq 0) {
"Added ${KeyID}."
} else {
"Unknown Error: " + "{0:x0}" -f $retval.ReturnValue
}
}
}
# Enable Keyboard Filter to block several custom keys
Enable-Custom-Key "Ctrl+v"
Enable-Custom-Key "Ctrl+v"
Enable-Custom-Key "Shift+4"
Enable-Custom-Key "Ctrl+Alt+w"
# List all the currently existing custom keys
$objCustomKeyList = get-WMIObject -namespace $NAMESPACE -class WEKF_CustomKey
foreach ($objCustomKeyItem in $objCustomKeyList) {
"Custom key: " + $objCustomKeyItem.Id
" enabled: " + $objCustomKeyItem.Enabled
}
```
## Related articles
- [WEKF_CustomKey](wekf-customkey.md)
- [Keyboard Filter](index.md)

View File

@ -0,0 +1,88 @@
---
title: WEKF_CustomKey.Remove
description: WEKF_CustomKey.Remove
ms.date: 01/13/2025
ms.topic: reference
author: TerryWarwick
ms.author: twarwick
---
# WEKF_CustomKey.Remove
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
Removes a custom key combination, causing Keyboard Filter to stop blocking the removed key combination.
## Syntax
```powershell
[Static] uint32 Remove(
[In] string CustomKey
);
```
## Parameters
**CustomKey**</br>\[in\] The custom key combination to remove.
## Return Value
Returns an HRESULT value that indicates [WMI status](/windows/win32/wmisdk/wmi-non-error-constants) or a [WMI error](/windows/win32/wmisdk/wmi-error-constants).
## Remarks
**WEKF_CustomKey.Remove** removes an existing **WEKF_CustomKey** object. If the object doesn't exist, **WEKF_CustomKey.Remove** returns an error with the value 0x8007007B.
Because this method is static, you can't call it on an object instance, but must instead call it at the class level.
## Example
The following code demonstrates how to remove a custom key from Keyboard Filter so it's no longer blocked by using the Windows Management Instrumentation (WMI) providers for Keyboard Filter.
```powershell
$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"
# Create a handle to the class instance so we can call the static methods
$classCustomKey = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WEKF_CustomKey"
# Create a function to remove a key combination
function Remove-Custom-Key($KeyId) {
# Call the static Remove() method on the class reference
$retval = $classCustomKey.Remove($KeyId)
# Check the return value for status
if ($retval.ReturnValue -eq 0) {
# Custom key combination removed successfully
"Removed ${KeyID}."
} elseif ($retval.ReturnValue -eq 2147942523) {
# No object exists with the specified custom key
"Failed to remove ${KeyID}. No object found."
} else {
# Unknown error, report error code in hexadecimal
"Failed to remove ${KeyID}. Unknown Error: " + "{0:x0}" -f $retval.ReturnValue
}
}
# Example of removing a custom key so that Keyboard Filter stops blocking it
Remove-Custom-Key "Ctrl+Alt+w"
# Example of removing all custom keys that have the Enabled property set to false
$objDisabledCustomKeys = Get-WmiObject -Namespace $NAMESPACE -Class WEKF_CustomKey;
foreach ($objCustomKey in $objDisabledCustomKeys) {
if (!$objCustomKey.Enabled) {
Remove-Custom-Key($objCustomKey.Id);
}
}
```
## Related topics
- [WEKF_CustomKey](wekf-customkey.md)
- [Keyboard Filter](index.md)

View File

@ -0,0 +1,114 @@
---
title: WEKF_PredefinedKey
description: WEKF_PredefinedKey
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_PredefinedKey
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
This class blocks or unblocks predefined key combinations, such as Ctrl+Alt+Delete.
## Syntax
```powershell
class WEKF_PredefinedKey {
[Static] uint32 Enable (
[In] string PredefinedKey
);
[Static] uint32 Disable (
[In] string PredefinedKey
);
[Key] string Id;
[Read, Write] boolean Enabled;
};
```
## Members
The following tables list any constructors, methods, fields, and properties that belong to this class.
### Methods
| Methods | Description |
|:-----------------------------------------------------------|:---------------------------------------|
| [WEKF_PredefinedKey.Enable](wekf-predefinedkeyenable.md) | Blocks the specified predefined key. |
| [WEKF_PredefinedKey.Disable](wekf-predefinedkeydisable.md) | Unblocks the specified predefined key. |
### Properties
| Property | Data type | Qualifiers | Description |
|:------------|:----------|:--------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **Id** | string | [key] | The name of the predefined key combination. |
| **Enabled** | Boolean | [read, write] | Indicates whether the key is blocked or unblocked. To indicate that the key is blocked, specify **true**. To indicate that the key isn't blocked, specify **false**. |
### Remarks
All accounts have read access to the **WEKF_PRedefinedKey** class, but only administrator accounts can modify the class.
For a list of predefined key combinations for Keyboard Filter, see [Predefined key combinations](predefined-key-combinations.md).
## Example
The following sample Windows PowerShell script blocks the Ctrl+Alt+Delete and the Ctrl+Esc key combinations when the Keyboard Filter service is running.
```powershell
<#
.Synopsis
This script shows how to use the built in WMI providers to enable and add
Keyboard Filter rules through Windows PowerShell on the local computer.
.Parameter ComputerName
Optional parameter to specify a remote machine that this script should
manage. If not specified, the script will execute all WMI operations
locally.
#>
param (
[String] $ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"}
$CommonParams += $PSBoundParameters
function Enable-Predefined-Key($Id) {
<#
.Synposis
Toggle on a Predefined Key Keyboard Filter Rule
.Description
Use Get-WMIObject to enumerate all WEKF_PredefinedKey instances,
filter against key value "Id", and set that instance's "Enabled"
property to 1/true.
.Example
Enable-Predefined-Key "Ctrl+Alt+Delete"
Enable CAD filtering
#>
$predefined = Get-WMIObject -class WEKF_PredefinedKey @CommonParams |
where {
$_.Id -eq "$Id"
};
if ($predefined) {
$predefined.Enabled = 1;
$predefined.Put() | Out-Null;
Write-Host Enabled $Id
} else {
Write-Error $Id is not a valid predefined key
}
}
# Some example uses of the function defined above.
Enable-Predefined-Key "Ctrl+Alt+Delete"
Enable-Predefined-Key "Ctrl+Esc"
```
## Related articles
- [Keyboard Filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
- [Keyboard Filter](index.md)

View File

@ -0,0 +1,36 @@
---
title: WEKF_PredefinedKey.Disable
description: WEKF_PredefinedKey.Disable
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_PredefinedKey.Disable
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
Unblocks the specified predefined key combination.
## Syntax
```powershell
[Static] uint32 Disable(
[In] string PredefinedKey
);
```
## Parameters
**PredefinedKey**</br>\[in\] The predefined key combination to unblock. For a list of predefined keys, see [Predefined key combinations](predefined-key-combinations.md).
## Return Value
Returns an HRESULT value that indicates [WMI Non-error constant](/windows/win32/wmisdk/wmi-non-error-constants) or a [WMI error constant](/windows/win32/wmisdk/wmi-error-constants).
## Related articles
- [WEKF_PredefinedKey](wekf-predefinedkey.md)
- [Keyboard Filter](index.md)

View File

@ -0,0 +1,35 @@
---
title: WEKF_PredefinedKey.Enable
description: WEKF_PredefinedKey.Enable
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_PredefinedKey.Enable
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
This method blocks the specified predefined key combination.
## Syntax
```powershell
[Static] uint32 Enable(
[In] string PredefinedKey
);
```
## Parameters
**PredefinedKey**</br>The predefined key combination to block. For a list of predefined keys, see [Predefined key combinations](predefined-key-combinations.md).
## Return Value
Returns an HRESULT value that indicates [WMI non-error constant](/windows/win32/wmisdk/wmi-non-error-constants) or a [WMI error constant](/windows/win32/wmisdk/wmi-error-constants).
## Related articles
- [WEKF_PredefinedKey](wekf-predefinedkey.md)
- [Keyboard Filter](index.md)

View File

@ -0,0 +1,128 @@
---
title: WEKF_Scancode
description: WEKF_Scancode
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_Scancode
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
Blocks or unblocks key combinations by using the keyboard scan code, which is an integer number that is generated whenever a key is pressed or released.
## Syntax
```powershell
class WEKF_Scancode {
[Static] uint32 Add(
[In] string Modifiers,
[In] uint16 scancode
);
[Static] uint32 Remove(
[In] string Modifiers,
[In] uint16 Scancode
);
[Key] string Modifiers;
[Key] uint16 Scancode;
[Read, Write] boolean Enabled;
}
```
## Members
The following tables list any constructors, methods, fields, and properties that belong to this class.
### Methods
| Methods | Description |
|---------|-------------|
| [WEKF_Scancode.Add](wekf-scancodeadd.md) | Adds a new custom scan code combination and enables Keyboard Filter to block the new scan code combination. |
| [WEKF_Scancode.Remove](wekf-scancoderemove.md) | Removes the specified custom scan code combination. Keyboard Filter stops blocking the scan code combination that was removed. |
### Properties
| Property | Data&nbsp;type | Qualifiers | Description |
|----------|----------------|------------|-------------|
| **Modifiers** | string | [key] | The modifier keys that are part of the key combination to block. |
| **Scancode** | uint16 | [key] | The scan code part of the key combination to block. |
| **Enabled** | Boolean | [read, write] | Indicates whether the scan code is blocked or unblocked. This property can be one of the following values:</br>- **true** Indicates that the scan code is blocked.</br>- **false** Indicates that the scan code isn't blocked. |
### Remarks
Scan codes are generated by the keyboard whenever a key is pressed. The same physical key will always generate the same scan code, regardless of which keyboard layout is currently being used by the system.
You can specify key combinations by including the modifier keys in the *Modifiers* parameter of the **Add** method or by modifying the **Modifiers** property. The most common modifier names are <kbd>>Ctrl</kbd>, <kbd>>Shift</kbd>, <kbd>>Alt</kbd>, and <kbd>>Win</kbd>.
## Example
The following code demonstrates how to add or enable a keyboard scan code that Keyboard Filter will block by using the Windows Management Instrumentation (WMI) providers for Keyboard Filter. This example modifies the properties directly, and doesn't call any of the methods defined in **WEKF_Scancode**.
```powershell
<#
.Synopsis
This script shows how to use the WMI provider to enable and add
Keyboard Filter rules through Windows Powershell on the local computer.
.Parameter ComputerName
Optional parameter to specify a remote machine that this script should
manage. If not specified, the script will execute all WMI operations
locally.
#>
param (
[String] $ComputerName
)
$CommonParams = @{"namespace"="root\standardcimv2\embedded"}
$CommonParams += $PSBoundParameters
function Enable-Scancode($Modifiers, [int]$Code) {
<#
.Synopsis
Toggle on a Scancode Keyboard Filter Rule
.Description
Use Get-WMIObject to enumerate all WEKF_Scancode instances,
filter against key values of "Modifiers" and "Scancode", and set
that instance's "Enabled" property to 1/true.
In the case that the Scancode instance does not exist, add a new
instance of WEKF_Scancode using Set-WMIInstance.
.Example
Enable-Predefined-Key "Ctrl+V"
Enable filtering of the Ctrl + V sequence.
#>
$scancode =
Get-WMIObject -class WEKF_Scancode @CommonParams |
where {
($_.Modifiers -eq $Modifiers) -and ($_.Scancode -eq $Code)
}
if($scancode) {
$scancode.Enabled = 1
$scancode.Put() | Out-Null
"Enabled Custom Scancode {0}+{1:X4}" -f $Modifiers, $Code
} else {
Set-WMIInstance `
-class WEKF_Scancode `
-argument @{Modifiers="$Modifiers"; Scancode=$Code} `
@CommonParams | Out-Null
"Added Custom Scancode {0}+{1:X4}" -f $Modifiers, $Code
}
}
# Some example uses of the function defined above.
Enable-Scancode "Ctrl" 37
```
## Related articles
[Keyboard Filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
[Keyboard Filter](index.md)

View File

@ -0,0 +1,44 @@
---
title: WEKF_Scancode.Add
description: WEKF_Scancode.Add
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_Scancode.Add
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
This method adds a new custom scan code combination and enables Keyboard Filter to block the new combination.
## Syntax
```powershell
[Static] uint32 Add(
[In] string Modifiers,
[In] uint16 Scancode
);
```
## Parameters
**Modifers**</br>The modifier keys that are part of the key combination to block.
**Scancode**</br>The hardware scan code of the key to block.
## Return Value
Returns an HRESULT value that indicates [WMI non-error constant](/windows/win32/wmisdk/wmi-non-error-constants) or a [WMI error constant](/windows/win32/wmisdk/wmi-error-constants).
## Remarks
**WEKF_Scancode.Add** creates a new **WEKF_Scancode** object and sets the **Enabled** property of the new object to **true**.
If a **WEKF_Scancode** object already exists with same *Modifiers* and *Scancode* properties, then **WEKF_Scancode.Add** returns an error code and doesn't create a new object or modify any properties of the existing object. If the existing **WEKF_Scancode** object has the **Enabled** property set to **false**, Keyboard Filter doesn't block the scan code.
## Related articles
- [WEKF_Scancode](wekf-scancode.md)
- [Keyboard Filter](index.md)

View File

@ -0,0 +1,44 @@
---
title: WEKF_Scancode.Remove
description: WEKF_Scancode.Remove
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_Scancode.Remove
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
This method removes a custom scan code key combination, causing Keyboard Filter to stop blocking the removed combination.
## Syntax
```powershell
[Static] uint32 Remove(
[In] string Modifiers,
[In] uint16 Scancode
);
```
## Parameters
**Modifiers**</br>The modifier keys of the combination to remove.
**Scancode**</br>The scan code of the combination to remove.
## Return Value
Returns an HRESULT value that indicates [WMI non-error constant](/windows/win32/wmisdk/wmi-non-error-constants) or a [WMI error constant](/windows/win32/wmisdk/wmi-error-constants).
## Remarks
**WEKF_Scancode.Remove** removes an existing **WEKF_Scancode** object. If the object doesn't exist, **WEKF_Scancode.Remove** returns an error with the value 0x8007007B.
Because this method is static, you can't call it on an object instance, but must instead call it at the class level.
## Related articles
- [WEKF_Scancode](wekf-scancode.md)
- [Keyboard Filter](index.md)

View File

@ -0,0 +1,97 @@
---
title: WEKF_Settings
description: WEKF_Settings
author: TerryWarwick
ms.author: twarwick
ms.date: 01/13/2025
ms.topic: reference
---
# WEKF_Settings
[!INCLUDE [supported-os-enterprise-plus](../../../includes/iot/supported-os-enterprise-plus.md)]
Enables or disables settings for Keyboard Filter.
## Syntax
```powershell
class WEKF_Settings {
[Key] string Name;
[Read, Write] string Value;
};
```
## Members
The following tables list any methods and properties that belong to this class.
### Properties
| Property | Data&nbsp;type | Qualifiers | Description |
|----------|----------------|------------|-------------|
| **Name** | string | [key] | Indicates the name of the Keyboard Filter setting that this object represents. See the Remarks section for a list of valid setting names. |
| **Value** | string | [read,&nbsp;write] | Represents the value of the **Name** setting. The value isn't case-sensitive. </br> See the Remarks section for a list of valid values for each setting. |
### Remarks
You must be signed in to an administrator account to make any changes to this class.
Each **WEKF_Settings** object represents a single Keyboard Filter setting. You can enumerate across all **WEKF_Settings** objects to see the value of all Keyboard Filter settings.
The following table lists all settings available for Keyboard Filter.
| Setting name | Description |
|--------------|-------------|
| **DisableKeyboardFilterForAdministrators** | This setting specifies whether Keyboard Filter is enabled or disabled for administrator accounts. Set to **true** to disable Keyboard Filter for administrator accounts; otherwise, set to **false**. Set to **true** by default. |
| **ForceOffAccessibility** | This setting specifies whether Keyboard Filter blocks users from enabling Ease of Access features. Set to **true** to force disabling the Ease of Access features. Set to **false** to allow enabling the Ease of Access features. Set to **false** by default.</br>Changing this setting to **false** doesn't automatically enable Ease of Access features; you must manually enable them. |
| **BreakoutKeyScanCode** | This setting specifies the scan code of the key that enables a user to break out of an account that is locked down with Keyboard Filter. A user can press this key consecutively five times to switch to the Welcome screen.</br>By default, the BreakoutKeyScanCode is set to the scan code for the left Windows logo key. |
One instance of the **WEKF_Settings** class exists for each valid setting.
Changes to the **DisableKeyboardFilterForAdministrator** setting are applied when an administrator account signs in, and applies to all applications run during the user session. If a user without an administrator account runs an application as an administrator, Keyboard Filter is still enabled, regardless of the **DisableKeyboardFilterForAdministrator** setting.
Changes to the **BreakoutKeyScanCode** setting don't take effect until you restart the device.
If the **BreakoutKeyScanCode** is set to the scan code for either the left Windows logo key or the right Windows logo key, both Windows Logo keys will work as the breakout key.
The **BreakoutKeyScanCode** setting only applies to accounts where Keyboard Filter is active. If the scan code is set to a value that doesn't map to any key, such as 0 (zero), then you must use another method to access the Welcome screen if you need to service the device, such as remotely connecting, or restarting the device if automatic sign-in isn't enabled.
> [!IMPORTANT]
> On some devices, if the breakout key is pressed too rapidly, the key presses may not register. We recommend that you include a slight pause between each breakout key press.
> [!WARNING]
> When setting the **BreakoutKeyScanCode**, be sure to use the scan code of the key, and not the virtual key value.
### Example
The following Windows PowerShell script demonstrates how to use this class to modify the breakout mode key for Keyboard Filter. This example sets the **BreakoutKeyScanCode** setting to the scan code for the Home key on a standard keyboard.
```powershell
#---Define variables---
$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"
# Define the decimal scan code of the Home key
$HomeKeyScanCode = 71
# Get the BreakoutKeyScanCode setting from WEKF_Settings
$BreakoutMode = get-wmiobject -class wekf_settings -namespace $NAMESPACE | where {$_.name -eq "BreakoutKeyScanCode"}
# Set the breakout key to the Home key.
$BreakoutMode.value = $HomeKeyScanCode
# Push the change into the WMI configuration. You must restart your device before this change takes effect.
$BreakoutMode.put()
```
## Related articles
[Keyboard Filter WMI provider reference](keyboardfilter-wmi-provider-reference.md)
[Keyboard Filter](index.md)

View File

@ -15,7 +15,7 @@ metadata:
appliesto:
- ✅ <a href=https://learn.microsoft.com/windows/release-health/supported-versions-windows-client target=_blank>Windows 11</a>
- ✅ <a href=https://learn.microsoft.com/windows/release-health/supported-versions-windows-client target=_blank>Windows 10</a>
ms.date: 05/23/2024
ms.date: 01/14/2025
title: Microsoft Connected Cache Frequently Asked Questions
summary: |
Frequently asked questions about Microsoft Connected Cache
@ -35,10 +35,10 @@ sections:
answer: |
- Azure subscription
- Hardware to host Microsoft Connected Cache
- Ubuntu 20.04 LTS on a physical server or VM of your choice.
- Ubuntu 22.04 LTS on a physical server or VM of your choice.
> [!NOTE]
> The Microsoft Connected Cache is deployed and managed using Azure IoT Edge and Ubuntu 20.04 is an [Azure IoT Edge Tier 1 operating system](/azure/iot-edge/support?view=iotedge-2020-11#tier-1). Additionally, the Microsoft Connected Cache module is optimized for Ubuntu 20.04 LTS.
> The Microsoft Connected Cache is deployed and managed using Azure IoT Edge and Ubuntu 22.04 is an [Azure IoT Edge Tier 1 operating system](/azure/iot-edge/support#tier-1). Additionally, the Microsoft Connected Cache module is optimized for Ubuntu 22.04 LTS.
The following are recommended hardware configurations:

View File

@ -13,7 +13,7 @@ appliesto:
- ✅ <a href=https://learn.microsoft.com/windows/release-health/supported-versions-windows-client target=_blank>Windows 11</a>
- ✅ <a href=https://learn.microsoft.com/windows/release-health/supported-versions-windows-client target=_blank>Windows 10</a>
- ✅ <a href=https://learn.microsoft.com/windows/deployment/do/waas-microsoft-connected-cache target=_blank>Microsoft Connected Cache for ISPs</a>
ms.date: 05/23/2024
ms.date: 01/14/2024
---
# Operator sign up and service onboarding for Microsoft Connected Cache
@ -36,7 +36,7 @@ Before you begin sign up, ensure you have the following components:
1. **Peering DB**: Ensure your organization's [Peering DB](https://www.peeringdb.com/) page is up-to-date and active. Check that the NOC email listed is accurate, and that you have access to this email.
1. **Server**: Ensure the server you wish to install Microsoft Connected Cache on is ready, and that the server is installed on Ubuntu 20.04 LTS.
1. **Server**: Ensure the server you wish to install Microsoft Connected Cache on is ready, and that the server is installed on Ubuntu 22.04 LTS.
1. **Configure cache drive**: Make sure that you have a data drive configured with full permissions on your server. You'll need to specify the location for this cache drive during the cache node configuration process. The minimum size for the data drive is 100 GB. For instructions to mount a disk on a Linux VM, see [Attach a data disk to a Linux VM](/azure/virtual-machines/linux/attach-disk-portal#find-the-disk).
## Resource creation and sign up process

View File

@ -13,7 +13,7 @@ appliesto:
- ✅ <a href=https://learn.microsoft.com/windows/release-health/supported-versions-windows-client target=_blank>Windows 11</a>
- ✅ <a href=https://learn.microsoft.com/windows/release-health/supported-versions-windows-client target=_blank>Windows 10</a>
- ✅ <a href=https://learn.microsoft.com/windows/deployment/do/waas-microsoft-connected-cache target=_blank>Microsoft Connected Cache for ISPs</a>
ms.date: 05/23/2024
ms.date: 01/14/2025
---
# Support and troubleshooting
@ -97,6 +97,15 @@ Rerun the IoT Edge Check command to validate proper connectivity:
```bash
iotedge check -verbose
```
<br>
## Updating from Ubuntu 20.04 to 22.04
You can now provision Microsoft Connected Cache for ISP on Ubuntu 22.04.
If you have a cache node provisioned on Ubuntu 20.04, you will need to uninstall it first before updating to Ubuntu 22.04.
Once you have updated the system, download the provisioning package from Azure portal and run the provisioning script on the portal.
For more information on provisioning cache node, visit, [Create, provision and deploy cache node](mcc-isp-create-provision-deploy.md#provision-your-server).
<br>
## Diagnose and Solve Problems
@ -110,6 +119,7 @@ Within **Diagnose and solve problems**, select **Troubleshoot** under the type o
:::image type="content" source="images/mcc-isp-diagnose-solve-troubleshoot.png" alt-text="A screenshot of Azure portal showing the option to select Troubleshoot to continue troubleshooting common issues related to the installation of Microsoft Connected Cache." lightbox="images/mcc-isp-diagnose-solve-troubleshoot.png":::
## Steps to obtain an Azure subscription ID
To onboard onto Microsoft Connected Cache, you'll need an Azure subscription ID. Use the following steps to obtain your subscription ID:

View File

@ -12,7 +12,7 @@ ms.reviewer: mstewart
ms.collection: tier3
appliesto:
- ✅ <a href=https://learn.microsoft.com/windows/deployment/do/mcc-isp target=_blank>Microsoft Connected Cache for ISPs</a>
ms.date: 05/23/2024
ms.date: 01/14/2025
---
# Enhancing cache performance
@ -21,7 +21,7 @@ To make sure you're maximizing the performance of your cache node, review the fo
#### OS requirements
The Microsoft Connected Cache module is optimized for Ubuntu 20.04 LTS. Install Ubuntu 20.04 LTS on a physical server or VM of your choice.
The Microsoft Connected Cache module is optimized for Ubuntu 22.04 LTS. Install Ubuntu 22.04 LTS on a physical server or VM of your choice.
#### NIC requirements