Skip to content

raylib tools: show Cmd/Option in shortcut labels on macOS - #645

Merged
JanuszBedkowski merged 1 commit into
mainfrom
mp/platform_shortcut_labels
Nov 20, 2026
Merged

JanuszBedkowski merged 1 commit into
mainfrom
mp/platform_shortcut_labels

Conversation

@michalpelka

Copy link
Copy Markdown
Contributor

Summary

Dear ImGui swaps Cmd and Ctrl on macOS (io.ConfigMacOSXBehaviors), so in the raylib tools io.KeyCtrl already means Cmd. Shortcuts and Cmd+click already worked, but every label still said "Ctrl".

  • New RaylibWidgets/PlatformKeys.h: SHORTCUT_CTRL / SHORTCUT_ALT expand to "Cmd" / "Option" on macOS and "Ctrl" / "Alt" elsewhere. They are joined with the label literals at compile time (SHORTCUT_CTRL "+O"), so there is no runtime cost.
  • Help tables, menu shortcuts, tooltips, hints and status messages in these tools use the macros: multi_view_tls_registration, multi_session_registration, mandeye_raw_data_viewer, lidar_odometry_step_1, camera_lidar_calibration, camera_lidar_trajectory_viewer.
  • camera_lidar_trajectory_viewer read Ctrl straight from raylib. It now uses isShortcutModifierDown() / isShortcutModifierPressed(): Cmd on macOS, Ctrl elsewhere.
  • GLUT (*_legacy and other GLUT tools) are not touched.

User-visible changes

  • macOS: labels read Cmd+O, Shift+Option+click, and so on. In camera_lidar_trajectory_viewer the shortcuts and the colour-toggle tap now use Cmd only; before, both Ctrl and Cmd worked there.
  • Windows / Linux: no change. The strings are the same as before.

Testing

  • All raylib tools build on macOS. All changed C++ files pass clang-format 21.
  • Not yet built on Windows or Linux (CI covers both). Not tried by hand in a running app.

🤖 Generated with Claude Code

Dear ImGui swaps Cmd and Ctrl on macOS, so io.KeyCtrl already means Cmd
in the raylib tools, but every label still said "Ctrl". The new
SHORTCUT_CTRL / SHORTCUT_ALT macros in RaylibWidgets/PlatformKeys.h
expand to "Cmd" / "Option" on macOS and "Ctrl" / "Alt" elsewhere, and
are joined with the label literals at compile time.

camera_lidar_trajectory_viewer read Ctrl straight from raylib; it now
uses isShortcutModifierDown/Pressed (Cmd on macOS, Ctrl elsewhere).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JanuszBedkowski
JanuszBedkowski merged commit a411306 into main Nov 20, 2026
7 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.

2 participants