Skip to content

Name Tab as Tab in KeyChordMatcher, not its NamedKeyBegin alias [patch] - #654

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/imguiapp-652-tab-key-name
Oct 18, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/imguiapp-652-tab-key-name

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #652

What was wrong

ImGuiKey.Tab has the same value as the NamedKeyBegin range marker, and Enum.ToString() returns the marker's name. DisplayName and NoteNameOf both fell back to ToString(), which caused two problems:

  • Tab displayed as "NamedKeyBegin".
  • A captured Tab was stored as the note NAMEDKEYBEGIN. That never equals Chord.Parse("Tab"), so conflict checks missed the clash with DataTableCommands' default Tab and Shift+Tab bindings.

Change

  • DisplayName and NoteNameOf now name ImGuiKey.Tab explicitly ("Tab" and "TAB") ahead of the fallback.
  • TryMapKey still accepts NAMEDKEYBEGIN, so keymaps saved before this change keep working.

Tests

New cases in KeyChordMatcherTests:

  • Tab_IsNamedTabNotItsRangeMarker covers every acceptance case in the issue: DisplayName, Display("Shift+Tab"), the composed note, and equality with Chord.Parse for Tab, Ctrl+Tab and Shift+Tab.
  • TryMapKey_StillReadsTheOldNamedKeyBeginSpelling checks the old spelling still maps to Tab.
  • NoBindableKey_IsNamedAfterARangeMarker is a guard test over every bindable key.

With the fix reverted, two of these fail. With it, the full ImGui.Widgets.Tests run passes (1130/1130), as do the KeyChord* UI tests (12/12).


Generated by Claude Code

ImGuiKey.Tab shares its value with the NamedKeyBegin range marker, and
Enum.ToString() returns the marker's name. DisplayName and NoteNameOf fell
back to ToString(), so Tab displayed as "NamedKeyBegin" and was captured
as the note NAMEDKEYBEGIN, which never equals Chord.Parse("Tab"). A host
comparing chords for conflicts missed the clash with DataTableCommands'
default Tab and Shift+Tab bindings.

Both now name Tab explicitly ahead of the fallback. TryMapKey still reads
NAMEDKEYBEGIN, so keymaps saved before this keep working. A guard test
checks that no bindable key is named after a range marker.

Fixes #652

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3apQEs8uq9BSQJ2j8Z8mr
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyChordMatcher shows Tab as "NamedKeyBegin" and captures it as "NAMEDKEYBEGIN", so a captured Tab never equals the "Tab" bindings

2 participants