Skip to content

[202_105]: Replace Meta with platform-appropriate key name in shortcut …#2856

Merged
da-liii merged 4 commits intoMoganLab:mainfrom
divyansharma001:divyansharma001/202_105/fix_meta_key_display
Feb 26, 2026
Merged

[202_105]: Replace Meta with platform-appropriate key name in shortcut …#2856
da-liii merged 4 commits intoMoganLab:mainfrom
divyansharma001:divyansharma001/202_105/fix_meta_key_display

Conversation

@divyansharma001
Copy link
Copy Markdown
Contributor

Fixes #2822

What

Replace "Meta" with platform-appropriate key name in keyboard shortcut notification pop-ups:

  • Linux: display "Super" instead of "Meta"
  • Windows: display "Win" instead of "Meta"

Why

The notification "Use Meta+Tab in order to insert a tab" shows "Meta" which does not correspond to any key on modern keyboards. On Linux the key is labeled "Super", on Windows it is "Win".

How

In system_kbd_initialize in src/Texmacs/Server/tm_config.cpp, changed the Qt branch mapping for M- from localize("Meta::keyboard", true) to:

  • localize("Win::keyboard", true) on Windows
  • localize("Super::keyboard", true) on Linux

Also removed the dead ("meta::keyboard" "") dictionary entry from zh_CN.scm.

How to test

  1. Open Mogan on Linux
  2. Open a new empty document
  3. Press Tab
  4. Verify the notification shows "Use Super+Tab in order to insert a tab" (not "Meta+Tab")

Copilot AI review requested due to automatic review settings February 25, 2026 05:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the keyboard shortcut rendering so the M- modifier is shown with platform-appropriate key names in shortcut/help pop-ups (addressing issue #2822).

Changes:

  • Adjusts Qt keyboard modifier rendering for M- to display “Win” on Windows and “Super” elsewhere.
  • Removes an unused meta::keyboard dictionary entry from the zh_CN translation file.
  • Adds a developer note documenting the change and manual test steps.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Texmacs/Server/tm_config.cpp Changes Qt shortcut rendering for M- to “Win”/“Super” based on OS detection.
devel/202_105.md Documents the rationale, implementation, and manual test procedure for the shortcut label change.
TeXmacs/plugins/lang/dic/en_US/zh_CN.scm Removes an unused translation entry related to meta::keyboard.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Texmacs/Server/tm_config.cpp Outdated
Comment thread devel/202_105.md
@@ -0,0 +1,30 @@
# [202_105] "Meta" will appear in the keyboard shortcut notification pop-up
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar nit: the title reads ""Meta" will appear..." but this file documents a fix; consider changing to ""Meta" appears..." (or similar) to avoid implying this is expected behavior.

Suggested change
# [202_105] "Meta" will appear in the keyboard shortcut notification pop-up
# [202_105] "Meta" appears in the keyboard shortcut notification pop-up

Copilot uses AI. Check for mistakes.
@MoonL79
Copy link
Copy Markdown
Contributor

MoonL79 commented Feb 25, 2026

Please move the "How to Test" section in the document to the very top under its heading.

Copy link
Copy Markdown
Contributor

@MoonL79 MoonL79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@da-liii
Copy link
Copy Markdown
Contributor

da-liii commented Feb 25, 2026

What's the behavior on macOS?

@divyansharma001
Copy link
Copy Markdown
Contributor Author

On macOS, the original code falls through to the else branch, so it would display "Super" — which is incorrect since Mac keyboards label that key "Command" (⌘).

I've added an os_macos() check so the mapping is now:

Linux: "Super"
Windows: "Win"
macOS: "Command"

@da-liii da-liii merged commit 86e4f9d into MoganLab:main Feb 26, 2026
4 checks passed
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.

在快捷键提示悬浮框里会出现"Meta"

4 participants