Menu item accelerator does not get set for f1-f12 keys #21809

Open
opened 2026-01-31 07:55:28 +00:00 by claunia · 1 comment
Owner

Originally created by @PankajBhojwani on GitHub (Jun 4, 2024).

Windows Terminal version

No response

Windows build number

No response

Other Software

No response

Steps to reproduce

You need a build of terminal that has #17281 in it to repro this

  • Add an action to your new tab dropdown with f1 as the keybinding
  • Open the new tab dropdown
  • The action shows up, but the accelerator does not (there should be an accelerator that says the keybinding is f1)

Example json snippet to test this:

"keybindings": [
        {
            "id": "Terminal.CopyToClipboard",
            "keys": "f1"
        }
],
    "newTabMenu": 
    [
        {
            "type": "action",
            "id": "Terminal.CopyToClipboard"
        }
    ],

Preliminary investigation shows that MapVirtualKeyW (called in TerminalPage::_SetAcceleratorForMenuItem) returns 0 for any of the keys f1 through f12, and that's the issue

Expected Behavior

Accelerator should show up with f1 in it

Actual Behavior

There is no accelerator

Originally created by @PankajBhojwani on GitHub (Jun 4, 2024). ### Windows Terminal version _No response_ ### Windows build number _No response_ ### Other Software _No response_ ### Steps to reproduce You need a build of terminal that has #17281 in it to repro this - Add an action to your new tab dropdown with `f1` as the keybinding - Open the new tab dropdown - The action shows up, but the accelerator does not (there should be an accelerator that says the keybinding is `f1`) Example json snippet to test this: ``` "keybindings": [ { "id": "Terminal.CopyToClipboard", "keys": "f1" } ], "newTabMenu": [ { "type": "action", "id": "Terminal.CopyToClipboard" } ], ``` Preliminary investigation shows that `MapVirtualKeyW` (called in `TerminalPage::_SetAcceleratorForMenuItem`) returns `0` for any of the keys `f1` through `f12`, and that's the issue ### Expected Behavior Accelerator should show up with `f1` in it ### Actual Behavior There is no accelerator
claunia added the Issue-BugProduct-TerminalArea-UserInterface labels 2026-01-31 07:55:28 +00:00
Author
Owner

@lhecker commented on GitHub (Jun 5, 2024):

Something like the quake mode keybinding with its scancode should have similar issues, but for a different reason, right? Also, don't we need to show the strings in the command palette too? Maybe we should make it a property of KeyChord so we don't have to do it twice.

@lhecker commented on GitHub (Jun 5, 2024): Something like the quake mode keybinding with its scancode should have similar issues, but for a different reason, right? Also, don't we need to show the strings in the command palette too? Maybe we should make it a property of `KeyChord` so we don't have to do it twice.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21809