Skip to content

Bug: efc-viewer-processcmdkey-swallows-alt-mnemonics #467

Description

@drmoisan
  • Work Mode: full-bug

Summary

EfcViewer.ProcessCmdKey returns true for every Alt-modified key whenever a keyboard handler is
attached, so base.ProcessCmdKey never runs for any Alt combination. This disables the standard
WinForms mnemonic path for both of the form's menu strips.

Environment

  • OS/version: Windows 11 Pro 10.0.26200
  • Runtime: .NET Framework 4.8.1 WinForms VSTO add-in
  • UI path: QuickFiler/Viewers/EfcViewer.cs (Email Filer viewer form)
  • Data source or fixture: n/a - pure input-routing path

Steps to Reproduce

  1. Open the Email Filer viewer (EfcViewer) so that _keyboardHandler is attached.
  2. Press any Alt-modified accelerator that maps to a menu mnemonic on either menu strip.
  3. Observe that the menu does not open and the keyboard-dialog toggle is invoked instead.

Expected Behavior

Alt combinations that the QuickFiler keyboard handler does not claim should fall through to
base.ProcessCmdKey so WinForms can resolve menu mnemonics and standard accelerators normally.

Actual Behavior

EfcViewer.cs:94-105:

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
    if ((_keyboardHandler is not null) && (keyData.HasFlag(Keys.Alt)))
    {
        object sender = FromHandle(msg.HWnd);
        var e = new KeyEventArgs(keyData);
        _keyboardHandler.ToggleKeyboardDialogAsync(sender, e);
        return true;
    }

    return base.ProcessCmdKey(ref msg, keyData);
}

The guard tests only keyData.HasFlag(Keys.Alt) - it does not ask the handler whether it actually
claims this key. Returning true reports the key as fully handled, so no further processing occurs.

Logs / Screenshots

  • Attached minimal logs or screenshot
  • Code-read evidence recorded above (verified 2026-08-07 against the working tree).

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Keyboard-only users lose the menu mnemonic path on this form. The severity is bounded because the
menus remain reachable by mouse.

Source

From: docs/features/potential/2026-08-07-efc-viewer-processcmdkey-swallows-alt-mnemonics.md

Activity

  1. added a commit that references this issue on Aug 28, 2026
  2. drmoisan commented on Aug 31, 2026

    @drmoisan
    OwnerAuthor

    Closing as completed. Delivered under efc-controller-surface-defects-464, commit 28d244e5 ("fix(efc-464): restore the Alt+F and Alt+M menu mnemonics (#467)"), merged via PR #661 (merge commit ee7d0ec4), an ancestor of origin/main.

    Confirmed directly against origin/main: EfcViewer.ProcessCmdKey no longer returns true for every Alt-modified key. It now delegates to a new internal static bool ClaimsAltChord(IQfcKeyboardHandler handler, Keys keyData) helper, which masks the modifier bits and returns true only when the bare chord is Keys.Menu or Keys.None — i.e. only when nothing but Alt was pressed. Alt+F and Alt+M (and any other Alt-modified accelerator) now fall through to base.ProcessCmdKey, restoring the standard WinForms mnemonic path.

    All five of this issue's acceptance criteria in docs/features/active/efc-controller-surface-defects-464/spec.md are checked [x], including named tests asserting ClaimsAltChord returns false for Keys.Alt | Keys.F and Keys.Alt | Keys.M specifically.

    Verified during an admission check against the bugs-638-644-647 parallel run (2026-09-01). No branch or PR remains to ship; this was left open only as bookkeeping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions