[PR #10666] [MERGED] Introduce vk() and sc() key chord specifiers #28176

Open
opened 2026-01-31 09:26:47 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10666
Author: @lhecker
Created: 7/15/2021
Status: Merged
Merged: 7/20/2021
Merged by: @undefined

Base: mainHead: dev/lhecker/7539-key-bindings-impl


📝 Commits (10+)

📊 Changes

26 files changed (+541 additions, -332 deletions)

View changed files

📝 .github/actions/spelling/allow/allow.txt (+3 -2)
📝 .github/actions/spelling/allow/apis.txt (+3 -0)
📝 .github/actions/spelling/expect/expect.txt (+2 -0)
📝 doc/cascadia/profiles.schema.json (+4 -4)
📝 src/cascadia/LocalTests_SettingsModel/DeserializationTests.cpp (+9 -9)
📝 src/cascadia/LocalTests_SettingsModel/KeyBindingsTests.cpp (+121 -110)
📝 src/cascadia/LocalTests_SettingsModel/TerminalSettingsTests.cpp (+12 -12)
📝 src/cascadia/TerminalApp/CommandPalette.cpp (+11 -8)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+8 -6)
📝 src/cascadia/TerminalControl/KeyChord.cpp (+24 -19)
📝 src/cascadia/TerminalControl/KeyChord.h (+8 -6)
📝 src/cascadia/TerminalControl/KeyChord.idl (+3 -3)
📝 src/cascadia/TerminalControl/TermControl.cpp (+3 -0)
📝 src/cascadia/TerminalSettingsEditor/KeyChordListener.cpp (+3 -1)
📝 src/cascadia/TerminalSettingsModel/ActionMap.cpp (+18 -13)
📝 src/cascadia/TerminalSettingsModel/ActionMap.h (+3 -3)
📝 src/cascadia/TerminalSettingsModel/KeyChordSerialization.cpp (+67 -6)
📝 src/cascadia/TerminalSettingsModel/defaults-universal.json (+2 -2)
📝 src/cascadia/TerminalSettingsModel/defaults.json (+3 -3)
📝 src/cascadia/WindowsTerminal/AppHost.cpp (+48 -48)

...and 6 more files

📄 Description

This commit introduces an alternative to specifying key bindings as a combination of key modifiers and a character. It allows you to specify an explicit virtual key as vk(nnn).
Additionally this commit makes it possible to bind actions to scan codes. As scan code 41 appears to be the button below the Escape key on virtually all keyboards, we'll be able to bind the quake mode hotkey to win+sc(41) and have it work consistently across most if not all keyboard layouts.

PR Checklist

Validation Steps Performed

The following was tested both on US and DE keyboard layouts:

  • Ctrl+, opens settings ✔️
  • Win+` opens quake mode window ✔️
  • Ctrl+plus/minus increase/decrease font size ✔️

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/10666 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 7/15/2021 **Status:** ✅ Merged **Merged:** 7/20/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/7539-key-bindings-impl` --- ### 📝 Commits (10+) - [`0bb6e34`](https://github.com/microsoft/terminal/commit/0bb6e346482ff15ece738793ab5196f5ff5b219b) Introduce vk() and sc() key chord specifiers - [`561d40a`](https://github.com/microsoft/terminal/commit/561d40a5fad442a02c14a0922ea75db71aa43837) Improve til::from_wchars - [`7297b41`](https://github.com/microsoft/terminal/commit/7297b41914bfda8786dffe11b2e0e28ae9255bcb) Address reviewer comments - [`b8d6f68`](https://github.com/microsoft/terminal/commit/b8d6f68d585addeca387ceb220f5294385448177) Fix unit tests - [`9fb176b`](https://github.com/microsoft/terminal/commit/9fb176ba4917a69fa2d9e2acdf69b17a48c9655a) Fix formatting - [`877acab`](https://github.com/microsoft/terminal/commit/877acabc554fea2bbc9f467f6f577dcb6e53d23e) Fix spelling - [`f901604`](https://github.com/microsoft/terminal/commit/f90160477302b312f659fa589a46ea1a03d54afb) Fix audit checks - [`098aff1`](https://github.com/microsoft/terminal/commit/098aff14fcfaa631d76438ad6509c2c5497d115a) Update profiles.schema.json - [`bb6e64d`](https://github.com/microsoft/terminal/commit/bb6e64d816bb3f10a4538973938ae1655a5e2c4a) Fix x86 build - [`253072f`](https://github.com/microsoft/terminal/commit/253072f42e78b1e0b60fbd7dcb878ead6e98eee1) Improve documentation and til::from_wchars ### 📊 Changes **26 files changed** (+541 additions, -332 deletions) <details> <summary>View changed files</summary> 📝 `.github/actions/spelling/allow/allow.txt` (+3 -2) 📝 `.github/actions/spelling/allow/apis.txt` (+3 -0) 📝 `.github/actions/spelling/expect/expect.txt` (+2 -0) 📝 `doc/cascadia/profiles.schema.json` (+4 -4) 📝 `src/cascadia/LocalTests_SettingsModel/DeserializationTests.cpp` (+9 -9) 📝 `src/cascadia/LocalTests_SettingsModel/KeyBindingsTests.cpp` (+121 -110) 📝 `src/cascadia/LocalTests_SettingsModel/TerminalSettingsTests.cpp` (+12 -12) 📝 `src/cascadia/TerminalApp/CommandPalette.cpp` (+11 -8) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+8 -6) 📝 `src/cascadia/TerminalControl/KeyChord.cpp` (+24 -19) 📝 `src/cascadia/TerminalControl/KeyChord.h` (+8 -6) 📝 `src/cascadia/TerminalControl/KeyChord.idl` (+3 -3) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+3 -0) 📝 `src/cascadia/TerminalSettingsEditor/KeyChordListener.cpp` (+3 -1) 📝 `src/cascadia/TerminalSettingsModel/ActionMap.cpp` (+18 -13) 📝 `src/cascadia/TerminalSettingsModel/ActionMap.h` (+3 -3) 📝 `src/cascadia/TerminalSettingsModel/KeyChordSerialization.cpp` (+67 -6) 📝 `src/cascadia/TerminalSettingsModel/defaults-universal.json` (+2 -2) 📝 `src/cascadia/TerminalSettingsModel/defaults.json` (+3 -3) 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+48 -48) _...and 6 more files_ </details> ### 📄 Description This commit introduces an alternative to specifying key bindings as a combination of key modifiers and a character. It allows you to specify an explicit virtual key as `vk(nnn)`. Additionally this commit makes it possible to bind actions to scan codes. As scan code 41 appears to be the button below the Escape key on virtually all keyboards, we'll be able to bind the quake mode hotkey to `win+sc(41)` and have it work consistently across most if not all keyboard layouts. ## PR Checklist * [x] Closes #7539, Closes #10203 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed The following was tested both on US and DE keyboard layouts: * Ctrl+, opens settings ✔️ * Win+` opens quake mode window ✔️ * Ctrl+plus/minus increase/decrease font size ✔️ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:26:47 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28176