WEKF_PredefinedKey

Edições
✅ com suporte IoT Enterprise LTSC
✅ IoT Enterprise
✅ Enterprise LTSC
✅ Enterprise
✅ Education

Essa classe bloqueia ou desbloqueia combinações de teclas predefinidas, como Ctrl+Alt+Delete.

Sintaxe

class WEKF_PredefinedKey {
    [Static] uint32 Enable (
        [In] string PredefinedKey
    );
    [Static] uint32 Disable (
        [In] string PredefinedKey
    );

    [Key] string Id;
    [Read, Write] boolean Enabled;
};

Membros

As tabelas a seguir listam todos os construtores, métodos, campos e propriedades que pertencem a essa classe.

Métodos

Métodos Descrição
WEKF_PredefinedKey. Habilitar Bloqueia a chave predefinida especificada.
WEKF_PredefinedKey. Desabilitar Desbloqueia a chave predefinida especificada.

Propriedades

Propriedade Tipo de dados Eliminatórias Descrição
ID string [chave] O nome da combinação de teclas predefinida.
Habilitada Booliano [ler, escrever] Indica se a chave está bloqueada ou desbloqueada. Para indicar que a chave está bloqueada, especifique true. Para indicar que a chave não está bloqueada, especifique false.

Comentários

Todas as contas têm acesso de leitura à classe WEKF_PRedefinedKey , mas apenas contas de administrador podem modificar a classe.

Para obter uma lista de combinações de teclas predefinidas para o Filtro de teclado, consulte Combinações de teclas predefinidas.

Exemplo

O seguinte script do Windows PowerShell de exemplo bloqueia as combinações das teclas Ctrl+Alt+Delete e Ctrl+Esc quando o serviço Filtro de Teclado está em execução.

<#
.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"