[PR #10603] [MERGED] Use WinRT VirtualKeyModifiers instead of a custom enum #28138

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10603
Author: @mimvdb
Created: 7/10/2021
Status: Merged
Merged: 7/12/2021
Merged by: @undefined

Base: mainHead: dev/mimvdb/winrt_keychord


📝 Commits (4)

  • d2c571b Use WinRT VirtualKeyModifiers instead of a custom enum
  • 0f0fca7 Clean up long namespace references to VirtualKeyModifiers
  • 992bf1b Fix colon typo
  • 59942c5 Remove redundant variable

📊 Changes

11 files changed (+62 additions, -97 deletions)

View changed files

📝 src/cascadia/LocalTests_SettingsModel/DeserializationTests.cpp (+4 -3)
📝 src/cascadia/LocalTests_SettingsModel/KeyBindingsTests.cpp (+10 -9)
📝 src/cascadia/LocalTests_SettingsModel/TestUtils.h (+5 -3)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+7 -9)
📝 src/cascadia/TerminalControl/KeyChord.cpp (+12 -10)
📝 src/cascadia/TerminalControl/KeyChord.h (+4 -4)
📝 src/cascadia/TerminalControl/KeyChord.idl (+2 -12)
📝 src/cascadia/TerminalSettingsModel/ActionMap.h (+0 -2)
📝 src/cascadia/TerminalSettingsModel/ActionMapSerialization.cpp (+0 -29)
📝 src/cascadia/TerminalSettingsModel/KeyChordSerialization.cpp (+13 -12)
📝 src/cascadia/WindowsTerminal/IslandWindow.cpp (+5 -4)

📄 Description

Replaces KeyModifiers with the pretty much equivalent
VirtualKeyModifiers enum in winrt.

After doing this I noticed #10593 which changes the KeyChords a lot, but
it seems these PRs are still compatible

The issue also mentions replacing Vkey with
Windows::System::VirtualKey, but I chose not to because that enum only
includes a subset of the keys terminal supports here (no VK_OEM_* keys)

Validation Steps Performed

Changed key bind in config, and confirmed it still works after
restarting terminal

Closes #877


🔄 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/10603 **Author:** [@mimvdb](https://github.com/mimvdb) **Created:** 7/10/2021 **Status:** ✅ Merged **Merged:** 7/12/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/mimvdb/winrt_keychord` --- ### 📝 Commits (4) - [`d2c571b`](https://github.com/microsoft/terminal/commit/d2c571b53db12aa6a625fa3ea9ffedc3a3067b40) Use WinRT VirtualKeyModifiers instead of a custom enum - [`0f0fca7`](https://github.com/microsoft/terminal/commit/0f0fca7a7c2f73a2a1a2396ffcf54f0117418a26) Clean up long namespace references to VirtualKeyModifiers - [`992bf1b`](https://github.com/microsoft/terminal/commit/992bf1b7b0cb949cdfad08017aeefc1e0d466439) Fix colon typo - [`59942c5`](https://github.com/microsoft/terminal/commit/59942c51e986c42b61a9aa386169bc18fd2ef038) Remove redundant variable ### 📊 Changes **11 files changed** (+62 additions, -97 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/LocalTests_SettingsModel/DeserializationTests.cpp` (+4 -3) 📝 `src/cascadia/LocalTests_SettingsModel/KeyBindingsTests.cpp` (+10 -9) 📝 `src/cascadia/LocalTests_SettingsModel/TestUtils.h` (+5 -3) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+7 -9) 📝 `src/cascadia/TerminalControl/KeyChord.cpp` (+12 -10) 📝 `src/cascadia/TerminalControl/KeyChord.h` (+4 -4) 📝 `src/cascadia/TerminalControl/KeyChord.idl` (+2 -12) 📝 `src/cascadia/TerminalSettingsModel/ActionMap.h` (+0 -2) 📝 `src/cascadia/TerminalSettingsModel/ActionMapSerialization.cpp` (+0 -29) 📝 `src/cascadia/TerminalSettingsModel/KeyChordSerialization.cpp` (+13 -12) 📝 `src/cascadia/WindowsTerminal/IslandWindow.cpp` (+5 -4) </details> ### 📄 Description Replaces `KeyModifiers` with the pretty much equivalent `VirtualKeyModifiers` enum in winrt. After doing this I noticed #10593 which changes the KeyChords a lot, but it seems these PRs are still compatible The issue also mentions replacing Vkey with `Windows::System::VirtualKey`, but I chose not to because that enum only includes a subset of the keys terminal supports here (no VK_OEM_* keys) ## Validation Steps Performed Changed key bind in config, and confirmed it still works after restarting terminal Closes #877 --- <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:34 +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#28138