[PR #2872] [MERGED] Improve debugging experience of key events... #25128

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/2872
Author: @miniksa
Created: 9/24/2019
Status: Merged
Merged: 9/24/2019
Merged by: @DHowett-MSFT

Base: masterHead: dev/miniksa/input


📝 Commits (1)

  • 7d219e2 Improve debugging experience of key events by adding natvis rules for display and by typifying the flags field so the debugger presents it as flags naturally.

📊 Changes

4 files changed (+46 additions, -15 deletions)

View changed files

📝 src/types/IInputEventStreams.cpp (+1 -1)
📝 src/types/KeyEvent.cpp (+9 -5)
📝 src/types/inc/IInputEvent.hpp (+31 -9)
📝 tools/ConsoleTypes.natvis (+5 -0)

📄 Description

...by adding natvis rules for display and by typifying the flags field so the debugger presents it as flags naturally.

Summary of the Pull Request

I was investigating #2770 and needed to visualize some of the input records more easily.

PR Checklist

  • Closes nothing. It's a standalone debugging aid.
  • I work here.
  • No tests.
  • No documentation.
  • I'm a core contributor.

Detailed Description of the Pull Request / Additional comments

I added a natvis rule that helps present the contents of a KEY_EVENT in a condensed way that is easier to navigate in the debugger than expanding all of the fields from the structure.

I also changed the definition of the flags field inside the KEY_EVENT to be an enum class because the debugger will auto-visualize these. To reduce the scope of the change, I made it static_cast things in and out of the enum class type (since they're both just DWORD defined with the same thing anyway) and changed all complaining reads/writes to round through the existing constexpr methods.

Validation Steps Performed

Rebuilt it and looked at it under the debugger. Looks way better than before.

Everything else still runs.


🔄 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/2872 **Author:** [@miniksa](https://github.com/miniksa) **Created:** 9/24/2019 **Status:** ✅ Merged **Merged:** 9/24/2019 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `dev/miniksa/input` --- ### 📝 Commits (1) - [`7d219e2`](https://github.com/microsoft/terminal/commit/7d219e2ddb100d3a5c4b4b1b2cef075bb7cc2aa8) Improve debugging experience of key events by adding natvis rules for display and by typifying the flags field so the debugger presents it as flags naturally. ### 📊 Changes **4 files changed** (+46 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/types/IInputEventStreams.cpp` (+1 -1) 📝 `src/types/KeyEvent.cpp` (+9 -5) 📝 `src/types/inc/IInputEvent.hpp` (+31 -9) 📝 `tools/ConsoleTypes.natvis` (+5 -0) </details> ### 📄 Description ...by adding natvis rules for display and by typifying the flags field so the debugger presents it as flags naturally. <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request I was investigating #2770 and needed to visualize some of the input records more easily. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [X] Closes nothing. It's a standalone debugging aid. * [X] I work here. * [X] No tests. * [X] No documentation. * [X] I'm a core contributor. <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments I added a natvis rule that helps present the contents of a `KEY_EVENT` in a condensed way that is easier to navigate in the debugger than expanding all of the fields from the structure. I also changed the definition of the flags field inside the `KEY_EVENT` to be an enum class because the debugger will auto-visualize these. To reduce the scope of the change, I made it static_cast things in and out of the enum class type (since they're both just DWORD defined with the same thing anyway) and changed all complaining reads/writes to round through the existing constexpr methods. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Rebuilt it and looked at it under the debugger. Looks way better than before. Everything else still runs. --- <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:07:28 +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#25128