Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the shared KeyVisual control used across PowerToys UI to correctly render arrow keys (Up/Down/Left/Right) in Settings by switching from private-use glyph codepoints (which were rendering as “box” placeholders) to standard Unicode arrow characters.
Changes:
- Call
Update()whenContent/RenderKeyAsGlyphchanges so the presenter content/style is refreshed immediately. - Add a null-guard in
Update()to avoid work (and potential issues) before the template child is available. - Replace the arrow key “glyph” codepoints with
↑/↓/←/→Unicode characters for reliable rendering.
|
Coding change is minimal, I think it's safe for 0.98.1? Although it's not regression |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| case VirtualKey.Up: | ||
| _keyPresenter.Content = "\uE0E4"; | ||
| SetGlyph("\uE0E4"); | ||
| break; | ||
|
|
||
| case VirtualKey.Down: | ||
| _keyPresenter.Content = "\uE0E5"; | ||
| SetGlyph("\uE0E5"); | ||
| break; | ||
|
|
||
| case VirtualKey.Left: | ||
| _keyPresenter.Content = "\uE0E2"; | ||
| SetGlyph("\uE0E2"); | ||
| break; | ||
|
|
||
| case VirtualKey.Right: | ||
| _keyPresenter.Content = "\uE0E3"; | ||
| SetGlyph("\uE0E3"); |
There was a problem hiding this comment.
The arrow key cases now call SetGlyph(...) directly, which bypasses the RenderKeyAsGlyph behavior that SetGlyphOrText(...) provides for Enter/Back/Shift. To keep the control’s API consistent (and allow RenderKeyAsGlyph=false to render arrows as text like "Up"/"Down"), route the arrow cases through SetGlyphOrText(glyph, virtualKey) instead of calling SetGlyph unconditionally.
|
|
||
| case VirtualKey.Up: | ||
| _keyPresenter.Content = "\uE0E4"; | ||
| SetGlyph("\uE0E4"); |
There was a problem hiding this comment.
Can we use SetGlyphOrText? or refactor it because it's doing partially the same thing as this new method?
There was a problem hiding this comment.
Oh, I did not realize we have this, right, we should make this cleaner
Summary of the Pull Request
Existing:

A box icon for whatever up, down, left, right, they are not treated as Glyph icon rendered, instead as normal text
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed