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

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