Repository navigation
raylib tools: show Cmd/Option in shortcut labels on macOS - #645
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dear ImGui swaps Cmd and Ctrl on macOS (
io.ConfigMacOSXBehaviors), so in the raylib toolsio.KeyCtrlalready means Cmd. Shortcuts and Cmd+click already worked, but every label still said "Ctrl".RaylibWidgets/PlatformKeys.h:SHORTCUT_CTRL/SHORTCUT_ALTexpand 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.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_viewerread Ctrl straight from raylib. It now usesisShortcutModifierDown()/isShortcutModifierPressed(): Cmd on macOS, Ctrl elsewhere.*_legacyand other GLUT tools) are not touched.User-visible changes
Cmd+O,Shift+Option+click, and so on. Incamera_lidar_trajectory_viewerthe shortcuts and the colour-toggle tap now use Cmd only; before, both Ctrl and Cmd worked there.Testing
🤖 Generated with Claude Code