This topic is more technical than most other knowledge base topics; it is recommended that only IT professionals and/or System Administrators utilize the information discussed below.
Sometimes users will want to limit a keyboard’s effectiveness in interacting with a Scala player. One of the approaches that can support this is the use of the Keyboard Filter feature that is available in Windows 10 and 11. Refer to the following Microsoft Learn webpage for details:
https://learn.microsoft.com/en-us/windows/configuration/keyboard-filter/
You can set up the key and/or key combination filtering feature using Windows Management Instrumentation (WMI) providers through the attached PowerShell scripts. These PowerShell scripts include:
EnableKeyboardFilter.ps1: enables the keyboard filter for a set of keys and/or key combinations.DisableKeyboardFilter.ps1: removes all the key and/or key combinations filtering on the system.ListKeyboardConfig.ps1: shows the current keyboard configuration.EnableWindowsKey.ps1: enables the Windows Key filteringDisableWindowsKey.ps1: disables the Windows Key filtering
This set contains the following custom key(s) and predefined keys.
Custom Key(s)
The default custom key to be filtered is:
ESCAPE
There are several examples at the end of EnableWindowsKey.ps1 that shows how to filter custom keys such as “Ctrl+V”, “Numpad0”, "Shift+Numpad0", “%”, “Ctrl+Alt+N”, etc. You may create other keys to be filtered by following these examples.
Predefined Key Combinations
The following are known Windows Key Combinations that are disabled by default.
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 key + F1 | Win+F1 | Open Windows Help. |
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 key + L | Win+L | Lock the device. |
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 key + U | Win+U | Open Ease of Access Center. |
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 key + F | Ctrl+Win+F | Open Find Computers. |
Windows key + Break | Win+Break | Open System dialog box. |
Windows key + E | Win+E | Open Windows Explorer. |
Windows + F | Win+F | Open Search. |
Windows key + P | Win+P | Cycle through Presentation Mode. Also blocks the Windows key + Shift + P and the Windows key + Ctrl + P key combinations. |
Windows 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 key + Tab | Win+Tab | Cycle through Microsoft Store apps. Also blocks the Windows key + Ctrl + Tab and Windows key + Shift + Tab key combinations. |
Windows key + D | Win+D | Show desktop. |
Windows key + M | Win+M | Minimize all windows. |
Windows key + Home | Win+Home | Minimize or restore all inactive windows. |
Windows key + T | Win+T | Set focus on taskbar and cycle through programs. |
Windows key + B | Win+B | Set focus in the notification area. |
Windows key + Minus Sign | Win+- | Zoom out. |
Windows key + Plus Sign | Win++ | Zoom in. |
Windows key + Esc | Win+Esc | Close Magnifier application. |
Windows key + Up Arrow | Win+Up | Maximize the active window. |
Windows key + Down Arrow | Win+Down | Minimize the active window. |
Windows key + Left Arrow | Win+Left | Snap the active window to the left half of screen. |
Windows key + Right Arrow | Win+Right | Snap the active window to the right half of screen. |
Windows key + Shift + Up Arrow | Win+Shift+Up | Maximize the active window vertically. |
Windows key + Shift + Down Arrow | Win+Shift+Down | Minimize the active window. |
Windows key + Shift + Left Arrow | Win+Shift+Left | Move the active window to left monitor. |
Windows key + Shift + Right Arrow | Win+Shift+Right | Move the active window to right monitor. |
Windows key + Spacebar | Win+Space | Switch layout. |
Windows key + O | Win+O | Lock device orientation. |
Windows key + Page Up | Win+PageUp | Move a Microsoft Store app to the left monitor. |
Windows key + Page Down | Win+PageDown | Move a Microsoft Store app to right monitor. |
Windows key + Period | Win+. | Snap the current screen to the left or right gutter. Also blocks the Windows key + Shift + Period key combination. |
Windows key + C | Win+C | Activate Cortana in listening mode (after user has enabled the shortcut through the UI). |
Windows key + I | Win+I | Open Settings charm. |
Windows key + K | Win+K | Open Connect charm. |
Windows key + H | Win+H | Start dictation. |
Windows key + Q | Win+Q | Open Search charm. |
Windows key + W | Win+W | Open Windows Ink workspace. |
Windows key + Z | Win+Z | Open app bar. |
Windows key + / | Win+/ | Open input method editor (IME). |
Windows key + J | Win+J | Swap between snapped and filled applications. |
Windows key + Comma | Win+, | Peek at the desktop. |
Windows key + V | Win+V | Cycle through toasts in reverse order. |
Setting up Windows Keyboard Filters
The steps to set up keyboard filters for our Windows players are as follows:
Turn on the Windows Keyboard Filter feature on your Windows player.
This feature is on by default, but you should verify it as follows:
In the Windows search bar, begin typing “Turn Windows features on or off” until a link by that name appears in the menu. Click the link to open the Windows Features window.
In the Windows Features window, expand the Device Lockdown node, then ensure the checkbox for Keyboard Filter is selected.
If the checkbox is cleared, select the checkbox, then restart your device.
Configure the Keyboard Filter using a PowerShell script
EnableKeyboardFilter.ps1in the KeyboardFilter.zip archive, which contains all the PowerShell scripts to configure and set up the Keyboard Filter. All the files mentioned below come from this archive.In
EnableKeyboardFilter.ps1, we have disabled all the predefined key combinations specified in the Predefined Key Combinations section.The Escape key is also disabled
If you want to disable other custom keys and/or scancodes, you can add additional lines at the end of the script. For example, you may filter:
Ctrl+V by entering
Enable-Custom-Key "Ctrl+V"END key on the NumPad by entering
Enable-Custom-Key "Shift+Numpad0"Ctrl+Alt+N by entering
Enable-Scancode "Ctrl+Alt" 49”; 49 is the scan code of N
Set up the Keyboard Filter on our player using Windows Task Scheduler[NM1.1] as follows:
Open Task Scheduler
Click Create Task
Under the General tab:
Name the task (e.g., “Enable Keyboard Filter for Player account and Disable Keyboard Filter for Config account”)
Select the Run only when user is logged on option.
Select a specific user in the When running the task, use the following user account field.
Optionally, select the Run with Highest privileges checkbox.
Under the Triggers tab:
Click the New… button, then select At logon in the Begin the task: field.
Select the Specific user option.
Click OK.
Under the Actions tab:
Click the New… button, then select Start a program in the Action field.
In the Program/script field, enter
powershell.exe.In the Add arguments field, enter:
-ExecutionPolicy Bypass -File "C:WindowsSystem32GroupPolicyMachineScriptsStartupEnableKeyboardFilter.ps1"for the Player account
-ExecutionPolicy Bypass -File "C:WindowsSystem32GroupPolicyMachineScriptsStartupDisableKeyboardFilter.ps1"for the Config account.
In summary, if the above three steps are performed, then the Keyboard Filter feature will be activated with defined custom key(s) and predefined key combinations in EnableKeyboardFilter.ps1 when Scala Player account is logged on, and the filtering will be deactivated when Scala Config account is logged on.
Setting up Linux Keyboard Filters
The steps to set up keyboard filters for our Windows players are as follows:
Installation can be done through its source or using PPA. You may use the following to install it from source:
git clone https://github.com/rvaiya/keyd cd keyd make && sudo make install sudo systemctl enable --now keydYou could also install it via PPA:
sudo add-apt-repository ppa:keyd-team/ppa sudo apt update sudo apt install keyd sudo systemctl enable --now keydConfiguration is done in
/etc/keyd/default.conf. Attached “default blockall.conf” and “default blocksome.conf” are two samples to block all the key inputs and block Esc, Ctrl+Shift+t and Alt+F4, respectively. Rename either of them todefault.confand put it under/etc/keyd/. You may use the key names defined in “keyd_key_names.txt” to configure whatever keys or key combinations you want to block.Start and stop the daemon. Because keyd is a system daemon, we suggest making sudoers with NOPASSWD first in Step 3.a below (otherwise, a password is required to start and stop keyd):
Edit sudoers to bypass password: Use
sudo visudoto edit the/etc/sudoersfile. Add the following two lines to it to bypass the password when we start and stop the daemon:config ALL=(ALL) NOPASSWD: /user/bin/systemctl stop keyd player ALL=(ALL) NOPASSWD: /user/bin/systemctl restart keydUse one of the following procedures
Use Config-Pro to stop and restart keyd by running
systemctl stop keyd, systemctl restart keydon Config and Player accounts, respectively.
Run the daemon automatically when logging on to the Player account and the daemon will stop when the Config account is logged on as follows:
Put attached
keyd-user-launch.shin/user/local/binMake it executable
chmod +x /usr/local/bin/keyd-user-launch.shAdd attached
keyd.desktopto each user’s autostart folder, i.e./home/config/.config/autostartand/home/plaer/.config/autostart.
Now daemon keyd will run on Player account and stop on Config account.
